Esempio n. 1
0
 def __init__(self, session, config, parent):
     SimpleNormalizer.__init__(self, session, config, parent)
     # Load types from config
     types = self.get_setting(session, 'posTypes')
     if types:
         self.types = types.split()
     else:
         # Default to nouns
         self.types = ['NN', 'NNP', 'NNS']
     # Should we keep the /POS tag or strip it
     self.keepPos = self.get_setting(session, 'pos', 0)
Esempio n. 2
0
 def __init__(self, session, config, parent):
     SimpleNormalizer.__init__(self, session, config, parent)
     # Load types from config
     types = self.get_setting(session, 'posTypes')
     if types:
         self.types = types.split()
     else:
         # Default to nouns
         self.types = ['NN', 'NNP', 'NNS']
     # Should we keep the /POS tag or strip it
     self.keepPos = self.get_setting(session, 'pos', 0)
Esempio n. 3
0
 def assoc_rgx_with_types(self, index=None):
     '''Associate a rgx with action categories.
     '''
     if index is not None:
         index = int(index)
         regex = sorted(self.game_state['regexes'], key=hash)[index]
     else:
         regex = self.game_state['current_rgx']
     self.categories()
     types = raw_input('Type numbers of categories to apply: ')
     types = map(categories.__getitem__, map(int, types.split()))
     types = set(map(itemgetter(0), types))
     self.game_state['types'][regex] |= types
     types = ', '.join(types)
     puts(green(regex) + ' --> ' + yellow(types))
Esempio n. 4
0
 def assoc_rgx_with_types(self, index=None):
     '''Associate a rgx with action categories.
     '''
     if index is not None:
         index = int(index)
         regex = sorted(self.game_state['regexes'], key=hash)[index]
     else:
         regex = self.game_state['current_rgx']
     self.categories()
     types = raw_input('Type numbers of categories to apply: ')
     types = map(categories.__getitem__, map(int, types.split()))
     types = set(map(itemgetter(0), types))
     self.game_state['types'][regex] |= types
     types = ', '.join(types)
     puts(green(regex) + ' --> ' + yellow(types))
Esempio n. 5
0
 def file_types(self):
     types = self._rfcindex.file_formats
     types = types.replace("ascii","txt")
     return ["."+x for x in types.split(",")]
Esempio n. 6
0
 def getQuotaTypes(self):
     """ Returns a list of valid quota types """
     types = self.conf.get("cyrus", "quota_types")
     types = types.split(",")
     return types
Esempio n. 7
0
 def file_types(self):
     types = self._rfcindex.file_formats
     types = types.replace("ascii", "txt")
     return ["." + x for x in types.split(",")]
Esempio n. 8
0
 def getQuotaTypes(self):
     """ Returns a list of valid quota types """
     types = self.conf.get("cyrus", "quota_types")
     types = types.split(",")
     return types