
    i
                     B    d dl mZmZ ddlmZ ddlmZ  G d de      Zy)    )ListTuple   )
Lemmatizer)Tokenc                   t     e Zd Zededeee   ee   f   f fd       Zdedee   fdZ	dedee   fdZ
 xZS )DutchLemmatizermodereturnc                 <    |dk(  rg d}|g fS t         |   |      S )Nrule)lemma_lookuplemma_rules	lemma_exclemma_index)superget_lookups_config)clsr
   required	__class__s      i/var/www/vps2.regionflexible.com/Desarrollo/venv/lib/python3.12/site-packages/spacy/lang/nl/lemmatizer.pyr   z"DutchLemmatizer.get_lookups_config   s)    6>RHb>!7-d33    tokenc                     | j                   j                  di       }|j                  j                         }|j	                  ||      gS )zOverrides parent method so that a lowercased version of the string
        is used to search the lookup table. This is necessary because our
        lookup table consists entirely of lowercase keys.r   )lookups	get_tabletextlowerget)selfr   lookup_tablestrings       r   lookup_lemmatizez DutchLemmatizer.lookup_lemmatize   sB     ||--nbA!!#  011r   c                 (   |j                   |j                  f}|| j                  v r| j                  |   S |j                  }|j                  j                         }|dv r"|j                         g}|| j                  |<   |S | j
                  j                  di       }| j
                  j                  di       }| j
                  j                  di       }|j                  |i       }	|j                  |i       }
|j                  |i       }|j                         }|dvr|g}|| j                  |<   |S |j                  |i       }||v r|g}|| j                  |<   |S | j
                  j                  di       }|j                  |i       }
	 |
|   d   g}|| j                  |<   |S # t        $ r Y nw xY w| j
                  j                  di       }|j                  |      }|r||v r|g}|| j                  |<   |S | j
                  j                  di       }g }|D ]b  \  }}|j                  |      s|d t        |      t        |      z
   |z   }|s8||	v r|g}|| j                  |<   |c S |j                  |       d t        t        j                  |            }|rH|D ]  }||
v s|g}|| j                  |<   |c S  |r|g}|| j                  |<   |S || j                  |<   |S |r|g}|| j                  |<   |S |g}|| j                  |<   |S )N) eolspacer   r   r   )	nounverbauxadjadvprondetadpnumr   r   )r   poscacher   pos_r   r   r   KeyErrorendswithlenappendlistdictfromkeys)r    r   	cache_keyr"   univ_posformsindex_table	exc_tablerules_tableindex
exceptionsrulesr   r!   looked_up_lemma	oov_formsoldnewforms                      r   rule_lemmatizezDutchLemmatizer.rule_lemmatize   s?    [[%)),	

"::i((::##%++\\^$E$)DJJy!Lll,,]B?LL**;;	ll,,]B?"-]]8R0
"- 

 

 HE$)DJJy!L!ooh3[ HE$)DJJy!LLL**;;	]]8R0
	'*+E$)DJJy!L 		 ||--nbA&**62+=$%E$)DJJy!Lll,,]B?	 
	+HCs#6Fc#h 67#=U]!FE,1DJJy) L$$T*
	+ T]]9-. !:%!FE,1DJJy) L	!
 ()(-

9%(-

9%$%E$)DJJy!LHE$)DJJy!Ls   F' '	F32F3)__name__
__module____qualname__classmethodstrr   r   r   r   r#   rI   __classcell__)r   s   @r   r	   r	      sf    4c 4eDItCy4H.I 4 42e 2S	 2aE ad3i ar   r	   N)typingr   r   pipeliner   tokensr   r	    r   r   <module>rT      s     " sj sr   