diff --git a/tests/test_readme.py b/tests/test_readme.py index 33e338de9..549318c4a 100644 --- a/tests/test_readme.py +++ b/tests/test_readme.py @@ -114,8 +114,8 @@ def test_term_counting(self): # sort by term ascending, then count descending observed_2 = sorted(bot.items(), key=itemgetter(1, 0), reverse=True)[:10] expected_2 = [ - ('nation', 6), ('world', 4), ('u.s.', 4), ('incarceration', 4), - ('decade', 4), ('system', 3), ('state', 3), ('record', 3), - ('problem', 3), ('people', 3)] + ('nation', 6), ('world', 4), ('incarceration', 4), ('system', 3), + ('state', 3), ('problem', 3), ('people', 3), ('minimum', 3), + ('mandatory', 3), ('lead', 3)] self.assertEqual(observed_1, expected_1) self.assertEqual(observed_2, expected_2) diff --git a/textacy/doc.py b/textacy/doc.py index b9d4cc268..05cb55eb4 100644 --- a/textacy/doc.py +++ b/textacy/doc.py @@ -472,7 +472,7 @@ def to_terms_list(self, ngrams=(1, 2, 3), named_entities=True, if n == 1: terms.append( (word for word in textacy.extract.words(self, **ngram_kwargs) - if (word.idx, word.idx + 1) not in ent_idxs)) + if (word.i, word.i + 1) not in ent_idxs)) else: terms.append( (ngram for ngram in textacy.extract.ngrams(self, n, **ngram_kwargs)