Package dataprocessor :: Package input :: Module xliffreader :: Class XliffReader
[hide private]
[frames] | no frames]

Class XliffReader

source code

  genericreader.GenericReader --+    
                                |    
genericxmlreader.GenericXmlReader --+
                                    |
                                   XliffReader

classdocs

Instance Methods [hide private]
 
load(self)
Loads the data of the file into memory.
source code
sentence.dataset.DataSet
get_dataset(self)
Returs the contents of the XML file into an object structure, which is represented by the DataSet object Note that this will cause all the data of the XML file to be loaded into system memory at once.
source code
 
length(self) source code
 
get_weights(self, tool_id)
Finds the global weights for particular tool ID in file.
source code
 
get_system_name(self, tool_id)
Finds a system name of given tool id
source code
 
get_parallelsentence(self, transUnit) source code
 
get_parallelsentences(self)
Returns: a list of ParallelSentence objects
source code
 
unload(self) source code
 
__read_attributes__(self, xmlEntry)
Returns: a dictionary of the attributes of the current sentence (name:value)
source code

Inherited from genericxmlreader.GenericXmlReader: __init__, get_attributes, get_tags, load_str, split_and_write

Method Details [hide private]

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

get_dataset(self)

source code 

Returs the contents of the XML file into an object structure, which is represented by the DataSet object Note that this will cause all the data of the XML 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 (saxjcml.py)

Returns: sentence.dataset.DataSet
A data set containing all the data of the XML file
Overrides: genericreader.GenericReader.get_dataset

length(self)

source code 
Overrides: genericxmlreader.GenericXmlReader.length

get_weights(self, tool_id)

source code 

Finds the global weights for particular tool ID in file. Used by function get_parallelsentences().

Returns:
global weights

get_system_name(self, tool_id)

source code 

Finds a system name of given tool id

Parameters:
  • tool_id (string) - tool-id
  • system_name (string)

get_parallelsentence(self, transUnit)

source code 
Overrides: genericreader.GenericReader.get_parallelsentence

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, ...]

Returns:
a list of ParallelSentence objects
Overrides: genericreader.GenericReader.get_parallelsentences

unload(self)

source code 
Overrides: genericreader.GenericReader.unload

__read_attributes__(self, xmlEntry)

source code 
Returns:
a dictionary of the attributes of the current sentence (name:value)