示例#1
0
 def process(self, lst):
     stemmer = self.stemmer
     result = []
     for s in lst:
         try:
             s = unicode(s)
         except UnicodeDecodeError:
             pass
         else:
             s = stemmer.stem((s,))[0]
         result.append(s)
     return result
示例#2
0
 def processGlob(self, lst):
     stemmer = self.stemmer
     result = []
     rxGlob = self.rxGlob
     for s in lst:
         if not rxGlob.search(s):
             try:
                 s = unicode(s)
             except UnicodeDecodeError:
                 pass
             else:
                 s = stemmer.stem((s,))[0]
         result.append(s)
     return result