a
     ˜ëjD  ã                   @   s   G d d„ dƒZ dS )c                   @   s@   e Zd ZdZddd„Zddd„Zdeeed	œd
d„Zdd„ ZdS )Ú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

    Tc                 C   s   ddl m} | |||¡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   Ú_morphy©ÚselfÚformÚposZcheck_exceptionsZwn© r   úP/mnt/bigstor/www/usecases/.venv/lib/python3.9/site-packages/nltk/stem/wordnet.pyr      s    	zWordNetLemmatizer._morphyNc                 C   s   ddl m} | |||¡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
        r   r   )r   r   Úmorphyr   r   r   r   r   +   s    zWordNetLemmatizer.morphyÚn)Úwordr
   Úreturnc                 C   s    |   ||¡}|rt|td�S |S )a±  Lemmatize `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   ÚminÚlen)r   r   r
   Zlemmasr   r   r   Ú	lemmatize<   s    zWordNetLemmatizer.lemmatizec                 C   s   dS )Nz<WordNetLemmatizer>r   )r   r   r   r   Ú__repr__X   s    zWordNetLemmatizer.__repr__)T)NT)r   )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Ústrr   r   r   r   r   r   r      s
   

r   N)r   r   r   r   r   Ú<module>   ó    