Package dataprocessor :: Package input :: Module linereader :: Class AttributeLineReader
[hide private]
[frames] | no frames]

Class AttributeLineReader

source code

genericreader.GenericReader --+
                              |
                             AttributeLineReader

Reads and combines strings and attributes from one-sentence-per-line data

Instance Methods [hide private]
 
__init__(self)
Constructor.
source code
 
get_parallelsentences(self)
Returns the contents of the parsed file into an a list with ParallelSentence objects.
source code

Inherited from genericreader.GenericReader: get_dataset, get_parallelsentence, load, unload

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Constructor. Creates a memory object that handles file data

Parameters:
  • input_xml_filename - the name of file
  • load - by turning this option to false, the instance will be initialized without loading everything into memory. This can be done later by calling .load() function
Overrides: genericreader.GenericReader.__init__
(inherited documentation)

get_parallelsentences(self)

source code 

Returns the contents of the parsed file into an a list with ParallelSentence objects. Note that this will cause all the data of the file to be loaded into system memory at once. For big data sets this may not be optimal, so consider sentence-by-sentence reading with SAX or CElementTree (e.g. saxjcml.py) @return the list of parallel sentences @rtype [ParallelSentence, ...]

Overrides: genericreader.GenericReader.get_parallelsentences
(inherited documentation)