504410df92f74a6471247909d01f4ca4639b91d8,tests/test_readme.py,ReadmeTestCase,test_term_counting,#ReadmeTestCase#,221

Before Change


        bot = self.doc.as_bag_of_terms(weighting="tf", normalized=False,
                                       lemmatize="auto", ngram_range=(1, 1))
        // sort by term ascending, then count descending
        observed_2 = sorted([(self.doc.spacy_stringstore[term_id], count)
                             for term_id, count in bot.most_common(n=10)],
                            key=itemgetter(0), reverse=False)
        observed_2 = sorted(observed_2, key=itemgetter(1), reverse=True)
        expected_2 = [("nation", 6), ("incarceration", 4), ("world", 4),
                      ("drug", 3), ("lead", 3), ("mandatory", 3), ("minimum", 3),
                      ("people", 3), ("problem", 3), ("male", 2)]

After Change


        // 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), ("state", 3), ("record", 3), ("problem", 3),
            ("people", 3), ("minimum", 3)]
        self.assertEqual(observed_1, expected_1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: chartbeat-labs/textacy
Commit Name: 504410df92f74a6471247909d01f4ca4639b91d8
Time: 2016-08-11
Author: burton@chartbeat.com
File Name: tests/test_readme.py
Class Name: ReadmeTestCase
Method Name: test_term_counting


Project Name: scikit-learn-contrib/DESlib
Commit Name: 0e17f47e9a4920e276bb61b60d6de16264bc6bcf
Time: 2017-12-29
Author: rafaelmenelau@gmail.com
File Name: pythonds/util/aggregation.py
Class Name:
Method Name: majority_voting


Project Name: scikit-learn-contrib/DESlib
Commit Name: 61aff20b59879b64ad562c2faa5f85ad0ee75592
Time: 2018-01-13
Author: rafaelmenelau@gmail.com
File Name: pythonds/base.py
Class Name: DS
Method Name: _hardness_region_competence