aaa0d4fcdff881ccbd69d4be0e370ac55b930f10,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):
logging.info("saving documents mapping to %s" % fname)
After Change
@staticmethod
def loadDictionary(fname):
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)
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 7
Instances 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
Project Name: okfn-brasil/serenata-de-amor
Commit Name: 54542222784567071f368d9e07900621afb15b8d
Time: 2017-05-26
Author: eu@caiocarrara.com.br
File Name: jarbas/api/tests/test_reimbursement_view.py
Class Name: TestRetrieveApi
Method Name: test_contents
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: pyannote/pyannote-audio
Commit Name: a7e7045b38fb48f347f3f7b8b15129df57475d79
Time: 2016-12-15
Author: bredin@limsi.fr
File Name: pyannote/audio/embedding/callbacks.py
Class Name: SpeakerRecognitionValidation
Method Name: on_epoch_end