
    Ng                     6    d dl Z d dlmZ  G d de          ZdS )    N)StemmerIc                   &    e Zd ZdZddZd Zd ZdS )RegexpStemmera  
    A stemmer that uses regular expressions to identify morphological
    affixes.  Any substrings that match the regular expressions will
    be removed.

        >>> from nltk.stem import RegexpStemmer
        >>> st = RegexpStemmer('ing$|s$|e$|able$', min=4)
        >>> st.stem('cars')
        'car'
        >>> st.stem('mass')
        'mas'
        >>> st.stem('was')
        'was'
        >>> st.stem('bee')
        'bee'
        >>> st.stem('compute')
        'comput'
        >>> st.stem('advisable')
        'advis'

    :type regexp: str or regexp
    :param regexp: The regular expression that should be used to
        identify morphological affixes.
    :type min: int
    :param min: The minimum length of string to stem
    r   c                 j    t          |d          st          j        |          }|| _        || _        d S )Npattern)hasattrrecompile_regexp_min)selfregexpmins      L/var/www/html/ai-engine/env/lib/python3.11/site-packages/nltk/stem/regexp.py__init__zRegexpStemmer.__init__*   s5    vy)) 	(Z''F			    c                 l    t          |          | j        k     r|S | j                            d|          S )N )lenr   r   sub)r   words     r   stemzRegexpStemmer.stem0   s2    t99ty  K<##B---r   c                 "    d| j         j        dS )Nz<RegexpStemmer: >)r   r   )r   s    r   __repr__zRegexpStemmer.__repr__6   s    ;$,"6;;;;r   N)r   )__name__
__module____qualname____doc__r   r   r    r   r   r   r      sP         6   . . .< < < < <r   r   )r	   nltk.stem.apir   r   r    r   r   <module>r"      sV    
			 " " " " " ")< )< )< )< )<H )< )< )< )< )<r   