JL iD GddZy)c<eZdZdZd dZd dZd dededefdZd Zy) WordNetLemmatizera WordNet Lemmatizer Provides 3 lemmatizer modes: _morphy(), morphy() and lemmatize(). lemmatize() is a permissive wrapper around _morphy(). It returns the shortest lemma found in WordNet, or the input string unchanged if nothing is found. >>> from nltk.stem import WordNetLemmatizer as wnl >>> print(wnl().lemmatize('us', 'n')) u >>> print(wnl().lemmatize('Anythinggoeszxcv')) Anythinggoeszxcv c4ddlm}|j|||S)z _morphy() is WordNet's _morphy lemmatizer. It returns a list of all lemmas found in WordNet. >>> from nltk.stem import WordNetLemmatizer as wnl >>> print(wnl()._morphy('us', 'n')) ['us', 'u'] wordnet) nltk.corpusr_morphyselfformposcheck_exceptionswns W/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/nltk/stem/wordnet.pyr zWordNetLemmatizer._morphys .zz$%566Nc4ddlm}|j|||S)aI morphy() is a restrictive wrapper around _morphy(). It returns the first lemma found in WordNet, or None if no lemma is found. >>> from nltk.stem import WordNetLemmatizer as wnl >>> print(wnl().morphy('us', 'n')) us >>> print(wnl().morphy('catss')) None rr)rrmorphyr s rrzWordNetLemmatizer.morphy+s .yys$455rwordr returncP|j||}|rt|tS|S)aLemmatize `word` by picking the shortest of the possible lemmas, using the wordnet corpus reader's built-in _morphy function. Returns the input word unchanged if it cannot be found in WordNet. >>> from nltk.stem import WordNetLemmatizer as wnl >>> print(wnl().lemmatize('dogs')) dog >>> print(wnl().lemmatize('churches')) church >>> print(wnl().lemmatize('aardwolves')) aardwolf >>> print(wnl().lemmatize('abaci')) abacus >>> print(wnl().lemmatize('hardrock')) hardrock :param word: The input word to lemmatize. :type word: str :param pos: The Part Of Speech tag. Valid options are `"n"` for nouns, `"v"` for verbs, `"a"` for adjectives, `"r"` for adverbs and `"s"` for satellite adjectives. :type pos: str :return: The shortest lemma of `word`, for the given `pos`. )key)r minlen)r rr lemmass r lemmatizezWordNetLemmatizer.lemmatize<s(2dC('-s6s#747rcy)Nz)r s r__repr__zWordNetLemmatizer.__repr__Xs$r)T)NT)n) __name__ __module__ __qualname____doc__r rstrrrrrrrr s0$ 76"8c88c88%rrN)rrrrr%sN%N%r