6e5ac39b4247082efdf934e0e03cc234ddcef529,src/gensim/corpora/dmlcorpus.py,DmlCorpus,loadDictionary,#Any#,176

Before Change


    
    @staticmethod
    def loadDictionary(fname):
        words = [line.split("\t")[1].strip() for line in open(fname) if len(line.split("\t")) == 2]
        id2word = dict(itertools.izip(xrange(len(words)), words))
        return id2word
    
    def saveDocuments(self, fname):

After Change


        result = {}
        for lineNo, line in enumerate(open(fname)):
            pair = line[:-1].split("\t")
            if len(pair) != 2:
                continue
            wordId, word = pair
            result[int(wordId)] = word
        return result
    
    def saveDocuments(self, fname):
        logging.info("saving documents mapping to %s" % fname)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: RaRe-Technologies/gensim
Commit Name: 6e5ac39b4247082efdf934e0e03cc234ddcef529
Time: 2010-04-02
Author: piskvorky@92d0401f-a546-4972-9173-107b360ed7e5
File Name: src/gensim/corpora/dmlcorpus.py
Class Name: DmlCorpus
Method Name: loadDictionary


Project Name: dit/dit
Commit Name: 37b54afef51c7430f8fa00db2f07e3532a7408da
Time: 2013-10-01
Author: chebee7i@gmail.com
File Name: dit/distribution.py
Class Name: BaseDistribution
Method Name: zipped


Project Name: RaRe-Technologies/gensim
Commit Name: 6e5ac39b4247082efdf934e0e03cc234ddcef529
Time: 2010-04-02
Author: piskvorky@92d0401f-a546-4972-9173-107b360ed7e5
File Name: src/gensim/corpora/dmlcorpus.py
Class Name: DmlCorpus
Method Name: loadDictionary


Project Name: RaRe-Technologies/gensim
Commit Name: aaa0d4fcdff881ccbd69d4be0e370ac55b930f10
Time: 2010-04-02
Author: radimrehurek@seznam.cz
File Name: src/gensim/corpora/dmlcorpus.py
Class Name: DmlCorpus
Method Name: loadDictionary