Source code for nltk.stem.api

# Natural Language Toolkit: Stemmer Interface
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Trevor Cohn <[email protected]>
#         Edward Loper <[email protected]>
#         Steven Bird <[email protected]>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT

[docs]class StemmerI(object): """ A processing interface for removing morphological affixes from words. This process is known as stemming. """
[docs] def stem(self, token): """ Strip affixes from the token and return the stem. :param token: The token that should be stemmed. :type token: str """ raise NotImplementedError()
if __name__ == "__main__": import doctest doctest.testmod(optionflags=doctest.NORMALIZE_WHITESPACE)