o
    rZhD                     @   s   G d d dZ dS )c                   @   sD   e Zd ZdZdddZdddZdd	ed
edef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      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   @/var/www/auris/lib/python3.10/site-packages/nltk/stem/wordnet.pyr      s   	zWordNetLemmatizer._morphyNc                 C   r   )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>   s   
