1 '''
2 Created on 13/05/2014
3
4 @author: david.vilares
5 '''
6
7 from miopia.analyzer.counter.Counter import Counter
8
10 '''
11 An abstract class which provides the basic operations for the counters
12 which rely on instances of L{SentimentDependencyGraph} to carry out their
13 analysis.
14 '''
15
16
22
23 - def _count(self, list_text_info):
24 """
25 @param list_text_info: A list of L{TextInfo} objects
26 """
27 dict_features = {}
28 graphs = [(text_info.get_textid(),text_info.get_dependency_graphs())
29 for text_info in list_text_info]
30
31 for textid, text_graphs in graphs:
32 for text_graph,address in text_graphs:
33 self._count_graph(textid,text_graph,address)
34 dict_graph= self._count_graph(textid,text_graph, address)
35
36 for key in dict_graph.keys():
37 try:
38 dict_features[key]+= 1
39 except KeyError:
40 dict_features[key] = 1
41
42 return dict_features
43
45 raise NotImplementedError
46