FunctionLemmatizer#
- class scikitplot.corpus.FunctionLemmatizer(fn, name='custom')[source]#
Wrap any
Callable[[str, Optional[str]], str]as aLemmatizerProtocol.- Parameters:
- fnCallable[[str], str] or Callable[[str, Optional[str]], str]
Lemmatization function. May accept an optional
posargument. If the function accepts only one argument theposparameter is silently dropped.- namestr, optional
Human-readable name.
- Parameters:
Examples
>>> lm = FunctionLemmatizer(lambda w: w.lower(), pos=None) >>> lm.lemmatize("Running", pos="v") 'running'