29b533feef93e61a61d4a935805ae1563583de2f,matutils.py,MmReader,__iter__,#MmReader#,138

Before Change


                prevId = docId
                document = []
            // add (termId, weight) pair to the document
            document.append((int(termId) - 1, float(val),)) // -1 because matrix market indexes are 1-based => convert to 0-based
        if prevId is not None: // handle the last document, as a special case
            yield prevId, document
//endclass MmReader

After Change


                                
                // return implicit (empty) documents between previous id and new id 
                // too, to keep consistent document numbering and corpus length
                for prevId in xrange(prevId + 1, docId):
                    yield prevId, []
                
                // from now on start adding fields to a new document, with a new id
                prevId = docId
                document = []
            
            document.append((termId, val,)) // add another field to the current document
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: RaRe-Technologies/gensim
Commit Name: 29b533feef93e61a61d4a935805ae1563583de2f
Time: 2010-01-30
Author: radimrehurek@seznam.cz
File Name: matutils.py
Class Name: MmReader
Method Name: __iter__


Project Name: PyMVPA/PyMVPA
Commit Name: c7cc116394497fb954eee67f996e1e14f32d9aec
Time: 2015-06-26
Author: debian@onerussian.com
File Name: mvpa2/datasets/eventrelated.py
Class Name:
Method Name: fit_event_hrf_model


Project Name: RaRe-Technologies/gensim
Commit Name: e4585c98f0c1f551cabac29813d5710966794dfb
Time: 2010-01-30
Author: piskvorky@92d0401f-a546-4972-9173-107b360ed7e5
File Name: matutils.py
Class Name: MmReader
Method Name: __iter__