nltk/nltk — Issue #220: 7 failures in collocations.doctest
Author: slattarini
Created: 2012-02-11 20:20:42+00:00
State: open

I'm seeing this failures on latest master (65f2cc4). I'm using python 2.6.6 and numpy 1.5.1, both installed from debian packages.

```
Testing nltk/test/collocations.doctest...
[Line 21] finder.nbest(bigram_measures.pmi, 10) # doctest: +NORMAL...
***************************************************************************
File "/devel/stefano/src/nelsearch/nltk/my/nltk/test/collocations.doctest", line 21, in nltk/test/collocations.doctest
Failed example:
finder.nbest(bigram_measures.pmi, 10) # doctest: +NORMALIZE_WHITESPACE
Expected:
[('cutting', 'instrument'), ('sewed', 'fig'), ('sweet', 'savor'),
('Ben', 'Ammi'), ('appoint', 'overseers'), ('olive', 'leaf'),
('months', 'later'), ('remaining', 'silent'), ('seek', 'occasion'),
('leaf', 'plucked')]
Got:
[(u'Allon', u'Bacuth'), (u'Ashteroth', u'Karnaim'), (u'Ben', u'Ammi'), (u'En', u'Mishpat'), (u'Jegar', u'Sahadutha'), (u'Salt', u'Sea'), (u'Whoever', u'sheds'), (u'appoint', u'overseers'), (u'aromatic', u'resin'), (u'cutting', u'instrument')]
[Line 42] finder.nbest(bigram_measures.pmi, 5) # doctest: +NORMALI...
***************************************************************************
File "/devel/stefano/src/nelsearch/nltk/my/nltk/test/collocations.doctest", line 42, in nltk/test/collocations.doctest
Failed example:
finder.nbest(bigram_measures.pmi, 5) # doctest: +NORMALIZE_WHITESPACE
Expected:
[(('weekend', 'N'), ('duty', 'N')),
(('top', 'ADJ'), ('official', 'N')),
(('George', 'NP'), ('P.', 'NP')),
(('medical', 'ADJ'), ('intern', 'N')),
(('1962', 'NUM'), ("governor's", 'N'))]
Got:
[(('1,119', 'NUM'), ('votes', 'N')), (('1962', 'NUM'), ("governor's", 'N')), (('637', 'NUM'), ('E.', 'NP')), (('Alpharetta', 'NP'), ('prison', 'N')), (('Bar', 'N'), ('Association', 'N'))]
[Line 53] finder.nbest(bigram_measures.pmi, 10) # doctest: +NORMAL...
***************************************************************************
File "/devel/stefano/src/nelsearch/nltk/my/nltk/test/collocations.doctest", line 53, in nltk/test/collocations.doctest
Failed example:
finder.nbest(bigram_measures.pmi, 10) # doctest: +NORMALIZE_WHITESPACE
Expected:
[(':', '('), ('(', 'NUM'), ('NUM', ')'), (':', 'NUM'), (')', 'NUM'),
('-', 'WH'), ('VN', ':'), ('``', 'EX'), ('EX', 'MOD'), ('WH', 'VBZ')]
Got:
[(':', '('), ('(', 'NUM'), ('NUM', ')'), (':', 'NUM'), ('', 'WH'), (')', 'NUM'), ('VN', ':'), ('``', 'EX'), ('EX', 'MOD'), ('WH', 'VBZ')]
[Line 65] finder.nbest(bigram_measures.likelihood_ratio, 10) # doct...
***************************************************************************
File "/devel/stefano/src/nelsearch/nltk/my/nltk/test/collocations.doctest", line 65, in nltk/test/collocations.doctest
Failed example:
finder.nbest(bigram_measures.likelihood_ratio, 10) # doctest: +NORMALIZE_WHITESPACE
Expected:
[('chief', 'chief'), ('hundred', 'years'), ('father', 'father'), ('lived', 'years'),
('years', 'father'), ('lived', 'father'), ('land', 'Egypt'), ('land', 'Canaan'),
('lived', 'hundred'), ('land', 'land')]
Got:
[(u'became', u'father'), (u'hundred', u'years'), (u'lived', u'years'), (u'father', u'became'), (u'years', u'became'), (u'land', u'Egypt'), (u'land', u'Canaan'), (u'lived', u'became'), (u'became', u'years'), (u'years', u'lived')]
[Line 182] print '%0.2f' % bigram_measures.likelihood_ratio(110, (25...
***************************************************************************
File "/devel/stefano/src/nelsearch/nltk/my/nltk/test/collocations.doctest", line 182, in nltk/test/collocations.doctest
Failed example:
print '%0.2f' % bigram_measures.likelihood_ratio(110, (2552, 221), 31777)
Expected:
270.72
Got:
541.44
[Line 184] print '%0.2f' % bigram_measures.likelihood_ratio(8, (13, ...
***************************************************************************
File "/devel/stefano/src/nelsearch/nltk/my/nltk/test/collocations.doctest", line 184, in nltk/test/collocations.doctest
Failed example:
print '%0.2f' % bigram_measures.likelihood_ratio(8, (13, 32), 31777)
Expected:
95.29
Got:
190.57
[Line 208] print '%0.2f' % cont_bigram_measures.likelihood_ratio(8, ...
***************************************************************************
File "/devel/stefano/src/nelsearch/nltk/my/nltk/test/collocations.doctest", line 208, in nltk/test/collocations.doctest
Failed example:
print '%0.2f' % cont_bigram_measures.likelihood_ratio(8, 5, 24, 31740)
Expected:
95.29
Got:
190.57
7 example(s) failed!

```