3

U'íc¹ã@s<ddlmZddlmZGdd„deƒZGdd„deƒZdS)é)ÚBaseStemmer)ÚAmongc#@sNeZdZdZeddOdƒedddƒeddPdƒeddQdƒedd	dƒed
d	dƒedddƒed
d	dƒedd	dƒedd	dƒeddRdƒedddƒedddƒeddSdƒedddƒedddƒeddTdƒedddƒedddƒedddƒedd dƒed!ddƒed"ddƒed#ddƒed$ddƒed%d&dƒed'd&dƒed(ddƒed)ddƒed*d+dƒed,dUdƒed-d.dƒg Zed/dVdWƒed0dXdYƒed1dZd[ƒed2d\d]ƒgZed3d^dƒed4ddƒed5ddƒed6d_dƒed7d`dƒgZd8d9d8dgZd:d;ddddddddddddddd<dd=gZ	d>d?d@d	dddddddddddddgZ
dZdZdAZ
dBdC„ZdDdE„ZdFdG„ZdHdI„ZdJdK„ZdLdM„ZdNS)aÚ
DanishStemmerz
    This class implements the stemming algorithm defined by a snowball script.
    Generated by Snowball 2.2.0 - https://snowballstem.org/
    ZhedrZethedéZeredÚeZeredeéZendeZerendeéZeneZerneZereÚenZhedené
ZerenZerZhederé
ZererÚséZhedséÚesZendeséZerendeséZenesZernesZeresZensZhedenséZerensZersZetsZeretséÚetZeretéÚgdÚdtÚgtZktÚigZligZeligZelsuløstéwéßééAé0é€éïéþé*ÚcCs°|j|_|j}|jd}||jkr&dS||_|j|_||_|jtjddƒsNdS|jtjddƒsbdS|jd7_|j|_y|j|jksŒtƒ‚|j|_Wntk
rªYnXdS)NrFéaéørT)	ÚlimitÚI_p1ÚcursorÚI_xZgo_out_groupingrÚg_vZgo_in_groupingÚlab0)ÚselfÚv_1Úc©r/úI/tmp/pip-build-gk9425m9/snowballstemmer/snowballstemmer/danish_stemmer.pyZ__r_mark_regionsIs*

zDanishStemmer.__r_mark_regionscCsŒ|j|jkrdS|j}|j|_|j|_|jtjƒ}|dkrD||_dS|j|_||_|dkrh|jƒsˆdSn |j	tj
ddƒs|dS|jƒsˆdSdS)NFrrr$éåT)r(r'Úlimit_backwardÚketÚfind_among_brÚa_0ÚbraÚ	slice_delÚ
in_grouping_bÚ
g_s_ending)r,Úv_2Ú	among_varr/r/r0Z__r_main_suffix_s&zDanishStemmer.__r_main_suffixcCsœ|j|j}|j|jkrdS|j}|j|_|j|_|jtjƒdkrL||_dS|j|_||_|j||_|j|jkrvdS|jd8_|j|_|j	ƒs˜dSdS)NFrrT)
r&r(r'r2r3r4rÚa_1r6r7)r,r-Úv_3r/r/r0Z__r_consonant_pairws&z DanishStemmer.__r_consonant_paircCs
|j|j}y@|j|_|jdƒs&tƒ‚|j|_|jdƒs>tƒ‚|jƒsJdSWntk
r`YnX|j||_|j|jkr~dS|j}|j|_|j|_|j	t
jƒ}|dkr²||_dS|j|_||_|dkrö|jƒsÔdS|j|j}|jƒ|j||_n|j
dƒsdSdS)NÚstrFrruløsT)r&r(r3Úeq_s_br+r6r7r'r2r4rÚa_2Ú _DanishStemmer__r_consonant_pairZ
slice_from)r,r-r=r;Úv_4r/r/r0Z__r_other_suffixsB

zDanishStemmer.__r_other_suffixcCs†|j|jkrdS|j}|j|_|j|_|jtjddƒs@||_dS|j|_|jƒ|_	|j	dkr`dS||_|j
|j	ƒsvdS|jƒs‚dSdS)NFébézr#T)r(r'r2r3r8rÚg_cr6Zslice_toÚS_chr?r7)r,r:r/r/r0Z__r_undouble²s$

zDanishStemmer.__r_undoublecCs°|j}|jƒ||_|j|_|j|_|j|j}|jƒ|j||_|j|j}|jƒ|j||_|j|j}|jƒ|j||_|j|j}|jƒ|j||_|j|_dS)NT)r(Ú_DanishStemmer__r_mark_regionsr2r&Ú_DanishStemmer__r_main_suffixrAÚ_DanishStemmer__r_other_suffixÚ_DanishStemmer__r_undouble)r,r-r:r=rBZv_5r/r/r0Ú_stemÇs&zDanishStemmer._stemNéÿÿÿÿrLrLrLrLrLrLrLrLrLrLrLrLrLrLrLrLrL)Ú__name__Ú
__module__Ú__qualname__Ú__doc__rr5r<r@rEr*r9r)r'rFrGrHrArIrJrKr/r/r/r0rsl





































*&%rc@seZdZdS)r+N)rMrNrOr/r/r/r0r+Ýsr+N)ZbasestemmerrZamongrrÚ
BaseExceptionr+r/r/r/r0Ú<module>sW