예제 #1
0
class MySplitter(object):
    def __init__(self):
        self._v_splitter = HTMLWordSplitter()
    def __call__(self, text, stopdict, *args, **kwargs):
        words = self._v_splitter._split(text)
        def lookup(w):
            return stopdict.get(w, w)
        return filter(None, map(lookup, words))
예제 #2
0
 def __init__(self):
     self._v_splitter = HTMLWordSplitter()