1 '''
2 Created on 28/05/2013
3
4 @author: David Vilares Calvo
5 '''
6
7 from miopia.parser.Parser import Parser
8 from miopia.adapter.Adapter import Adapter
9 from collections import defaultdict, OrderedDict
10 import os
11
12
14 '''
15 CompositeAdapter allows to combine different L{Adapter}'s to obtain a global ranking
16 off all features
17 '''
18 FEATURE_TYPE = "COMPOSITE_FEATURE_TYPE"
19
21 '''
22 @param path_weka: The path to the WEKA.jar
23 @param counter: An instance of L{CompositeAuxiliaryCounter}
24 '''
25 self._list_adapters = []
26 self._list_external_resources = []
27 super(CompositeAdapter,self).__init__(path_weka,counter,None)
28 self._dict_str_ftc_adapter_weight = {}
29
30 - def add(self,adapter):
36
43
45 """
46 Obtain the children of a L{CompositeAdapter}
47 """
48 return self._list_adapters
49
52
53
59
60
62 """
63 @return A dictionary with the number of features considered by the adapter in an instance
64 of a L{nltk.parse.dependencygraph.DependencyGraph}
65 """
66 dict_features = {}
67 for adapter in self._list_adapters:
68 dict_features.update(adapter.count_features(list_text_info))
69 return dict_features
70
78