Package mekano :: Module io :: Class TrecParser
[hide private]
[frames] | no frames]

Class TrecParser

source code

StateMachineFileParser --+
                         |
                        TrecParser

TREC file parser

tp = TrecParser(fin, callback)

The callback function receives (docid, text).

To begin parsing, use one of:

Instance Methods [hide private]
 
__init__(self, callback) source code
 
_onInit(self) source code
 
_onMisc(self, line)
Waiting for a new doc to start
source code
 
_onGotDocId(self, line)
Waiting for the TEXT section to start
source code
 
_onText(self, line)
Seeing text lines
source code

Inherited from StateMachineFileParser: close, parse, parseFile, parseFileName

Inherited from StateMachineFileParser (private): _introspect, _onFinish

Method Details [hide private]

__init__(self, callback)
(Constructor)

source code 
Overrides: StateMachineFileParser.__init__