Package dataprocessor :: Package input :: Module rankreader :: Class RankReader
[hide private]
[frames] | no frames]

Class RankReader

source code

genericreader.GenericReader --+
                              |
                             RankReader

Reader able to parse the ranking results from taraxu 1st evaluation round, as exported by cfedermann

Instance Methods [hide private]
 
__init__(self, input_xml_filename, load=True)
Constructor.
source code
 
load(self)
Loads the data of the file into memory.
source code
 
unload(self) source code
 
get_parallelsentences(self)
This function parses a ranking xml file and returns a list of parallel sentence objects.
source code

Inherited from genericreader.GenericReader: get_dataset, get_parallelsentence

Method Details [hide private]

__init__(self, input_xml_filename, load=True)
(Constructor)

source code 

Constructor. Creates an XML object that handles ranking file data

Parameters:
  • input_xml_filename (string) - the name of XML file
  • load (boolean) - by turning this option to false, the instance will be initialized without loading everything into memory
Overrides: genericreader.GenericReader.__init__

load(self)

source code 

Loads the data of the file into memory. It is useful if the Classes has been asked not to load the filename upon initialization

Overrides: genericreader.GenericReader.load

unload(self)

source code 
Overrides: genericreader.GenericReader.unload

get_parallelsentences(self)

source code 

This function parses a ranking xml file and returns a list of parallel sentence objects.

Parameters:
  • ps_list (list of tuples)
Overrides: genericreader.GenericReader.get_parallelsentences