FunctionStemmer#
- class scikitplot.corpus.FunctionStemmer(fn, name='custom')[source]#
Wrap any
Callable[[str], str]as aStemmerProtocol.- Parameters:
- fnCallable[[str], str]
Stemming function; takes a single word, returns its stem.
- namestr, optional
Human-readable name.
- Parameters:
Examples
>>> st = FunctionStemmer(lambda w: w[:4] if len(w) > 4 else w) >>> st.stem("running") 'runn'