Package miopia :: Package adapter :: Module NGramAdapter
[hide private]
[frames] | no frames]

Source Code for Module miopia.adapter.NGramAdapter

 1  ''' 
 2  Created on 25/09/2013 
 3   
 4  @author: David Vilares 
 5  ''' 
 6   
 7  from miopia.adapter.Feature import FeatureType 
 8  from miopia.adapter.RawAdapter import RawAdapter 
 9  from miopia.analyzer.counter.NGramCounter import NGramCounter 
10   
11 -class NGramAdapter(RawAdapter):
12 ''' 13 A WEKA adapter for L{NGramCounter} 14 ''' 15 16
17 - def __init__(self,path_weka, ngram_counter, weight_factor):
18 """ 19 @param path_weka: The path to the WEKA.jar 20 @param abstracted_lexicons_counter: An instance of L{NGramCounter} 21 @param weight_factor: A value {BINARY_WEIGHTING_FACTOR, TOTAL_WEIGHTING_FACTOR} 22 """ 23 24 25 if not isinstance(ngram_counter,NGramCounter): 26 raise ValueError 27 28 super(NGramAdapter,self).__init__(path_weka,ngram_counter,weight_factor)
29 30
31 - def _get_feature_type(self):
32 """ 33 The type of the feature 34 """ 35 return FeatureType.GRAM
36