1c219d8f678ba51948c3c78ad5480a3ba32581b0,gensim/corpora/dictionary.py,Dictionary,from_corpus,#Any#Any#,340

Before Change



        // now make sure length(result) == get_max_id(corpus) + 1
        if (tokens is None): tokens = map(str, xrange(max_id + 1))
        tokens_iter = iter(tokens)
        for i in xrange(max_id + 1):
            result.token2id[next(tokens_iter)] = i
            result.dfs[i] = result.dfs.get(i, 0)

        logger.info("built %s from %i documents (total %i corpus positions)" %

After Change


                result.dfs[wordid] = result.dfs.get(wordid, 0) + 1

        // now make sure length(result) == get_max_id(corpus) + 1
        if (id2word is None): id2word = list(map(str, xrange(max_id + 1)))
        for i in xrange(max_id + 1):
            result.token2id[id2word[i]] = i
            result.dfs[i] = result.dfs.get(i, 0)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: RaRe-Technologies/gensim
Commit Name: 1c219d8f678ba51948c3c78ad5480a3ba32581b0
Time: 2014-06-30
Author: amwebdk@gmail.com
File Name: gensim/corpora/dictionary.py
Class Name: Dictionary
Method Name: from_corpus


Project Name: beancount/smart_importer
Commit Name: 40a7ae25dd848dd686d126e7e6d7a5d51124003b
Time: 2018-05-09
Author: patrick@ch.tario.org
File Name: smart_importer/predict_payees.py
Class Name: PredictPayees
Method Name: enhance_transactions


Project Name: beancount/smart_importer
Commit Name: 40a7ae25dd848dd686d126e7e6d7a5d51124003b
Time: 2018-05-09
Author: patrick@ch.tario.org
File Name: smart_importer/predict_postings.py
Class Name: PredictPostings
Method Name: enhance_transactions