680de8d4f35325e7486c07c4e06422929e826b57,gensim/corpora/lowcorpus.py,LowCorpus,line2doc,#LowCorpus#Any#,145

Before Change


            // construct a list of (wordIndex, wordFrequency) 2-tuples
            doc = [(self.word2id.get(w), words.count(w)) for w in use_words]
        else:
            uniq_words = set(words)
            // construct a list of (word, wordFrequency) 2-tuples
            doc = [(w, words.count(w)) for w in uniq_words]

        // return the document, then forget it and move on to the next one
        // note that this way, only one doc is stored in memory at a time, not the whole corpus
        return doc

After Change


            // construct a list of (wordIndex, wordFrequency) 2-tuples
            doc = [(self.word2id[w], counts[w]) for w in use_words]
        else:
            word_freqs = Counter(words)
            // construct a list of (word, wordFrequency) 2-tuples
            doc = list(word_freqs.items())

        // return the document, then forget it and move on to the next one
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: RaRe-Technologies/gensim
Commit Name: 680de8d4f35325e7486c07c4e06422929e826b57
Time: 2019-01-10
Author: __Singleton__@hackerdom.ru
File Name: gensim/corpora/lowcorpus.py
Class Name: LowCorpus
Method Name: line2doc


Project Name: mozilla/bugbug
Commit Name: 03a907732b244d553236a3b1f3b79aaaa2945ad5
Time: 2020-10-20
Author: mcastelluccio@mozilla.com
File Name: scripts/testing_policy_stats.py
Class Name: TestingPolicyStatsGenerator
Method Name: go


Project Name: mittagessen/kraken
Commit Name: d8abd944a8b95b36ead150abbf6b42a9276bf660
Time: 2017-05-02
Author: mittagessen@l.unchti.me
File Name: kraken/train.py
Class Name: GroundTruthContainer
Method Name: __init__