-
Notifications
You must be signed in to change notification settings - Fork 27
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
No spaces before quotes #31
Comments
Hello! I think I've narrowed this down a bit: >>> detokenize(["He", "said", "''", "heya", "!", "''", "yesterday", "."])
"He said ''heya!'' yesterday." With NLTK version 3.6.7: >>> detokenize(["He", "said", "''", "heya", "!", "''", "yesterday", "."])
'He said"heya!" yesterday.' I'll workshop a quick fix to improve the performance a bit. |
I've got this quick testing script: for sentence in ["Hello, you're Tom!",
'He said "heya!" yesterday.',
'He said \'heya!\' yesterday.',
'He said \'\'heya!\'\' yesterday.',
'He\'s doing well, I think.',
]:
token = tokenize(sentence)
detoken = detokenize(token)
print(detoken) The new performance is:
versus the old performance:
(Note: using NLTK 3.6.7) Thank you for reporting this! Closed via f994465 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The detokenizer isn't prepending spaces before quotes like it says it should in the Tokenizer.py examples.
If I use one of the examples on the detokenizer:
["He", "said", "''", "heya", "!", "''", "yesterday", "."]
it returns:
He said"heya!" yesterday.
The text was updated successfully, but these errors were encountered: