Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in final apostrophe!! #3

Open
alvations opened this issue Jul 30, 2018 · 0 comments
Open

Bug in final apostrophe!! #3

alvations opened this issue Jul 30, 2018 · 0 comments

Comments

@alvations
Copy link
Contributor

alvations commented Jul 30, 2018

Bug in final apostrophe from original Moses!!

Original Moses:

$ cat in.txt 
dip dye hand-tufted ivory / navy area rug, 8' x 10'
azzura hill hand-tufted ivory indoor/outdoor area rug, 7'6" x 9'6"
caterine hand-tufted ivory area rug, 9' x 12'
de         cor hand-tufted ivory/navy area rug, 8' x 10'

$ cat in.txt | ~/mosesdecoder/scripts/tokenizer/tokenizer.perl -l en 
dip dye hand-tufted ivory / navy area rug , 8 ' x 10'
azzura hill hand-tufted ivory indoor / outdoor area rug , 7 ' 6 " x 9 ' 6 "
caterine hand-tufted ivory area rug , 9 ' x 12'
de cor hand-tufted ivory / navy area rug , 8 ' x 10'

SacreMoses output:

>>> from sacremoses import MosesTokenizer
>>> mt = MosesTokenizer()

>>> x = """dip dye hand-tufted ivory / navy area rug, 8' x 10'
... azzura hill hand-tufted ivory indoor/outdoor area rug, 7'6" x 9'6"
... caterine hand-tufted ivory area rug, 9' x 12'
... de         cor hand-tufted ivory/navy area rug, 8' x 10'
... """

>>> for sent in x.split('\n'):
...    print(mt.tokenize(sent.strip(), return_str=True))
... 
dip dye hand-tufted ivory / navy area rug , 8 ' x 10'
azzura hill hand-tufted ivory indoor / outdoor area rug , 7 ' 6 " x 9 ' 6 "
caterine hand-tufted ivory area rug , 9 ' x 12'
de cor hand-tufted ivory / navy area rug , 8 ' x 10'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant