Skip to content

Commit

Permalink
Fixes doctest for python3
Browse files Browse the repository at this point in the history
Dictionary hash are dynamic in Python3 so the __repr__ output will be different all the time. Doctest should check for value equality instead. 

Fixes issue on https://nltk.ci.cloudbees.com/job/nltk/TOXENV=py34-jenkins,jdk=jdk8latestOnlineInstall/lastCompletedBuild/testReport/nltk.tokenize.mwe/MWETokenizer/add_mwe/
  • Loading branch information
alvations committed Feb 26, 2016
1 parent f4089ac commit a488bb6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nltk/tokenize/mwe.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ def add_mwe(self, mwe):
>>> tokenizer.add_mwe(('a', 'b'))
>>> tokenizer.add_mwe(('a', 'b', 'c'))
>>> tokenizer.add_mwe(('a', 'x'))
>>> tokenizer._mwes.as_dict()
{'a': {'x': {True: None}, 'b': {True: None, 'c': {True: None}}}}
>>> expected = {'a': {'x': {True: None}, 'b': {True: None, 'c': {True: None}}}}
>>> tokenizer._mwes.as_dict() == expected
True
"""
self._mwes.insert(mwe)
Expand Down

0 comments on commit a488bb6

Please sign in to comment.