Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nltk | |
from collections import defaultdict | |
class SnowCastleStemmer(nltk.stem.SnowballStemmer): | |
""" A wrapper around snowball stemmer with a reverse lookip table """ | |
def __init__(self, *args, **kwargs): | |
super(self.__class__, self).__init__(*args, **kwargs) | |
self._stem_memory = defaultdict(set) | |
# switch stem and memstem |