You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks @jmccrae, your solution avoids inverting the single and the double quote. It may not be a complete fix though, because it does not suppress the extraneous space between the quotes, which was the purpose of the edited substitution in L291.
However, suppressing that space is the cause of the inversion, because a double quote is represented as two single quotes, and once you have three single quotes in a row, there is no way of knowing where the double quote begins or ends. This explains why the substitution in L296 outputs the double quote first.
Another solution would be to move L291 to after L296. This suppresses the space, but the output can be hard to discern in some fonts. So, after all, it may be desirable to leave a space between both kinds of quotes for readability, and then your proposed fix seems ok.
Steps to reproduce
This should produce
Note the inversion of
\'
and"
The fix seems to be to change:
nltk/nltk/tokenize/treebank.py
Line 291 in 8c233dc
To
The text was updated successfully, but these errors were encountered: