Package featuregenerator :: Module preprocessor :: Class Preprocessor
[hide private]
[frames] | no frames]

Class Preprocessor

source code

                       object --+    
                                |    
featuregenerator.FeatureGenerator --+
                                    |
                                   Preprocessor
Known Subclasses:

Instance Methods [hide private]
 
__init__(self, lang)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
add_features_src(self, simplesentence, parallelsentence=None)
Gets a source SimpleSentence and (optionally) its corresponding Parallelsentence and returns a SimpleSentence with the generated features Operates as a wrapper around the get_features_src method, which returns a dictionary with the generated features.
source code
 
add_features_tgt(self, simplesentence, parallelsentence=None)
Gets a target SimpleSentence and (optionally) its corresponding Parallelsentence and returns a SimpleSentence with the generated features Operates as a wrapper around the get_features_src method, which returns a dictionary with the generated features.
source code
 
process_string(self, string) source code

Inherited from featuregenerator.FeatureGenerator: add_features_batch, add_features_dataset, add_features_parallelsentence, add_features_simplesentence, get_annotation_name, get_features_parallelsentence, get_features_simplesentence, get_features_src, get_features_string, get_features_tgt, process_dataset

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, lang)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

add_features_src(self, simplesentence, parallelsentence=None)

source code 

Gets a source SimpleSentence and (optionally) its corresponding Parallelsentence and returns a SimpleSentence with the generated features
    Operates as a wrapper around the get_features_src method, which returns a dictionary with the generated features. 
    From it we receive the dictionary, we duplicate the source SimpleSentence object and we return a proper source SimpleSentence object containing the generated features.
@param simplesentence: The source sentence of a ParallelSentence
@type simplesentence: sentence.sentence.SimpleSentence 
@param parallelsentence: The parallelsentence containing the given source sentence. Can be omitted if the subclassed feature generator doesn't require the parallelsentence in order to deliver source features
@type parallelsentence: sentence.parallelsentence.ParallelSentence
@rtype: sentence.sentence.SimpleSentence 
@return: A source SimpleSentence object similar to the one given, but now containing the generated features.

Overrides: featuregenerator.FeatureGenerator.add_features_src
(inherited documentation)

add_features_tgt(self, simplesentence, parallelsentence=None)

source code 

Gets a target SimpleSentence and (optionally) its corresponding Parallelsentence and returns a SimpleSentence with the generated features
    Operates as a wrapper around the get_features_src method, which returns a dictionary with the generated features. 
    From it we receive the dictionary, we duplicate the target SimpleSentence object and we return a proper target SimpleSentence object containing the generated features.
@param simplesentence: The target sentence of a ParallelSentence
@type simplesentence: sentence.sentence.SimpleSentence 
@param parallelsentence: The parallelsentence containing the given target sentence. Can be omitted if the subclassed feature generator doesn't require the parallelsentence in order to deliver target features
@type parallelsentence: sentence.parallelsentence.ParallelSentence
@rtype: sentence.sentence.SimpleSentence 
@return: A target SimpleSentence object similar to the one given, but now containing the generated features.

Overrides: featuregenerator.FeatureGenerator.add_features_tgt
(inherited documentation)