1 '''
2 Created on 02/04/2014
3
4 @author: David Vilares
5 '''
6 from miopia.analyzer.counter.LexiconCounter import LexiconCounter
7 from miopia.util.TokenInfo import TokenInfo
8
10 '''
11 classdocs
12 '''
13
14 ALL = "ALL"
15 FIRST_MATCH = "FIRST_MATCH"
16
17 - def __init__(self, ftc, preprocessor, lexical_processor,
18 dict_lexicon, name_scoring, lowercase=True):
19
20 '''
21 Constructor
22 '''
23 super(ScorerCounter,self).__init__(ftc, preprocessor, lexical_processor,
24 dict_lexicon, lowercase)
25 self._scorings = set([self.ALL])
26 self._name_scoring = name_scoring
27
28
29
31
32 for scoring in self._scorings:
33 scoring+="_"+self._name_scoring
34 try:
35 d[self._id_of_feature(textid, initial_position, scoring)]+=value
36 except KeyError:
37 d[self._id_of_feature(textid, initial_position, scoring)]=value
38 return d
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54