Skip to content

Commit

Permalink
Update test_normalizer.py to include test for perl parity
Browse files Browse the repository at this point in the history
  • Loading branch information
NIXBLACK11 authored Oct 26, 2023
1 parent a57726d commit c57e777
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sacremoses/test/test_normalizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,9 @@ def test_normalization_pipeline(self):
text = "0《123》 456% '' 【789】"
expected = '0"123" 456% " [789]'
assert moses_norm_unicode.normalize(text) == expected

def test_moses_normalize_with_perl_parity(self):
moses_perl_parity = MosesPunctNormalizer(perl_parity=True)
text = 'from the ‘bad bank’, Northern, wala « dox ci jawwu Les « wagonways » étaient construits'
expected = '''from the 'bad bank," Northern, wala "dox ci jawwu Les "wagonways" étaient construits'''
assert moses_perl_parity.normalize(text) == expected

0 comments on commit c57e777

Please sign in to comment.