3

U'ícd?ã@sŒddlmZddlmZGdd„deƒZGdd„deƒZGdd„deƒZGd	d
„d
eƒZGdd„deƒZ	Gd
d„deƒZ
Gdd„deƒZdS)é)ÚBaseStemmer)ÚAmongc!@sÐeZdZdZedd{dƒedd|dƒedd}dƒedd~dƒedddƒed	d€dƒed
ddƒedd‚dƒeddƒdƒed
d„dƒg
Zedd…d†ƒedd‡dˆƒedd‰dŠƒedd‹dŒƒedddƒedddŽƒgZedddƒedd‘d’ƒedd“d”ƒedd•d–ƒeddd—ƒeddd˜ƒgZedd™dšƒedd›dœƒgZedddƒeddždƒeddŸdƒed d dƒed!d¡dƒed"d¢d#ƒed$d£d%ƒed&d¤d'ƒed(d¥dƒg	Z	ed)d¦d§ƒed*d¨d©ƒed+dªd«ƒed,d¬d­ƒed-d®d¯ƒed.d°d±ƒed/d²d³ƒgZ
ed0d´d1ƒedd2dµƒedd2d¶ƒedd2d·ƒedd2d¸ƒedd#d¹ƒedd#dºƒed3d#dƒedd»d¼ƒedd½d¾ƒed4d¿dÀƒed5dÁd6ƒedd7dƒed8d7dÂd9ƒed:d7dÃd;ƒed<d7dƒed=d7dÄd9ƒed>d7dƒed?d7dÅd9ƒed@d7d#ƒed	d7d'ƒedAd7d%ƒedBdÆd1ƒeddCdǃeddCdȃeddCdɃeddCdʃeddDd˃eddDd̃edEdDdƒgZedFdÍd΃edGdÏdƒedHddЃedIdÑdƒedJdd҃edKdÓdƒedLd'dԃedMdÕdƒedNd6dփedOd×d؃edPdÙdƒedQdRdڃedSdÛdƒedTdUd܃gZedVdÝdރedWdßdàƒgZ
edGdádƒedHd2dâƒgZdXdd2d2d2d2d2d2d2d2d2d2d2d2d2d2d1gZdYdZdYdgZdXd[d\dd2d2d2d2d2d2d2d2d2d2d2d2d1d2d]gZdXd[d\d2d2d2d2d2d2d2d2d2d2d2d2d2d1d2d]gZdXd^d_dd2d2d2d2d2d2d2d2d2d2d2d2d1d2d]gZd`ZdaZd2Zd2Zdbdc„Zddde„Zdfdg„Zdhdi„Zdjdk„Zdldm„Zdndo„Zdpdq„Zdrds„Z dtdu„Z!dvdw„Z"dxdy„Z#dzS)ãÚFinnishStemmerz
    This class implements the stemming algorithm defined by a snowball script.
    Generated by Snowball 2.2.0 - https://snowballstem.org/
    ÚparZstiéZkaanZhanZkinuhänukäänÚkoupäuköZllaÚnaZssaÚtaZltaéZstaulläunäussäutäultäustäZlleZineZnsaZmmeZnneÚniÚsiZanéÚenéuänéunsäZaaÚeeÚiiZooÚuuuääuööÚaééZttaÚksiÚnééZdenÚ_FinnishStemmer__r_VIÚseenÚ_FinnishStemmer__r_LONGZhenZttenZhinZsiinZhonuhönõäééuttäZejaZmmaZimmaÚmpaZimpaZmmiZimmiZmpiZimpiuejäummäuimmäé
umpäuimpäéÚiÚjééwéßéAéé éaéFÚcCs|j|_|j|_|jtjddƒs$dS|jtjddƒs8dS|jd7_|j|_|jtjddƒsbdS|jtjddƒsvdS|jd7_|j|_dS)Nr,éöFrT)ÚlimitÚI_p1ÚI_p2Zgo_out_groupingrÚg_V1Zgo_in_groupingÚcursor)Úself©r6úJ/tmp/pip-build-gk9425m9/snowballstemmer/snowballstemmer/finnish_stemmer.pyZ__r_mark_regions’szFinnishStemmer.__r_mark_regionscCs|j|jksdSdS)NFT)r2r4)r5r6r6r7Z__r_R2£szFinnishStemmer.__r_R2cCsŒ|j|jkrdS|j}|j|_|j|_|jtjƒ}|dkrD||_dS|j|_||_|dkrp|jtj	ddƒs|dSn|j
ƒs|dS|jƒsˆdSdS)NFrrr,r/T)r4r1Úlimit_backwardÚketÚfind_among_brÚa_0ÚbraÚ
in_grouping_bÚg_particle_endÚ_FinnishStemmer__r_R2Ú	slice_del)r5Úv_2Ú	among_varr6r6r7Z__r_particle_etc¨s&zFinnishStemmer.__r_particle_etccCsŽ|j|jkrdS|j}|j|_|j|_|jtjƒ}|dkrD||_dS|j|_||_|dkrª|j|j}y|j	dƒsxt
ƒ‚dSt
k
rŽYnX|j||_|jƒs¨dSnà|dkrì|jƒs¾dS|j|_|j	dƒsÔdS|j|_|jdƒsêdSnž|dkr|jƒsŠdSn„|d	kr6|jtj
ƒdkr&dS|jƒsŠdSnT|d
krf|jtjƒdkrVdS|jƒsŠdSn$|jtjƒdkr|dS|jƒsŠdSdS)NFrrÚkrZkserr
r
rT)r4r1r8r9r:rÚa_4r<r0Úeq_s_bÚlab0r@Z
slice_fromÚa_1Úa_2Úa_3)r5rArBÚv_3r6r6r7Z__r_possessive¿sb









zFinnishStemmer.__r_possessivecCs|jtjƒdkrdSdS)NrFT)r:rÚa_5)r5r6r6r7Z__r_LONGøszFinnishStemmer.__r_LONGcCs&|jdƒsdS|jtjddƒs"dSdS)Nr$Fr,r/T)rEr=rÚg_V2)r5r6r6r7Z__r_VIýs

zFinnishStemmer.__r_VIcCsB|j|jkrdS|j}|j|_|j|_|jtjƒ}|dkrD||_dS|j|_||_|dkrl|jdƒshdSn¾|dkr†|jdƒs‚dSn¤|dkr |jdƒsœdSnŠ|d	krº|jd
ƒs¶dSnp|dkrÔ|jdƒsÐdSnV|d
krî|jdƒsêdSn<|dkrô|j	|j}yÖ|j	|j}yl|j	|j}y|j
ƒs2tƒ‚tƒ‚Wntk
rPYnX|j	||_|jdƒs||j	||_t
ƒ‚Wntk
r”YnX|j	||_|j|jkrÂ|j	||_t
ƒ‚|jd8_|j|_Wnt
k
rðYnXn6|dkr*|jtjddƒsdS|jtjddƒs*dS|jƒs8dSd|_dS)NFrrrrÚer
r$r
ÚorrrõörZierr,r/ébézT)r4r1r8r9r:rÚa_6r<rEr0rÚlab2Úlab1rFr=r3Úg_Cr@ÚB_ending_removed)r5rArBrJÚv_4Úv_5r6r6r7Z__r_case_endings€











zFinnishStemmer.__r_case_endingcCs¬|j|jkrdS|j}|j|_|j|_|jtjƒ}|dkrD||_dS|j|_||_|dkrœ|j|j}y|j	dƒsxt
ƒ‚dSt
k
rŽYnX|j||_|jƒs¨dSdS)NFrrÚpoT)r4r2r8r9r:rÚa_7r<r0rErFr@)r5rArBrJr6r6r7Z__r_other_endingsDs.
z FinnishStemmer.__r_other_endingscCs^|j|jkrdS|j}|j|_|j|_|jtjƒdkr@||_dS|j|_||_|jƒsZdSdS)NFrT)	r4r1r8r9r:rÚa_8r<r@)r5rAr6r6r7Z__r_i_plural]szFinnishStemmer.__r_i_pluralcCs:|j|jkrdS|j}|j|_|j|_|jdƒs:||_dS|j|_|j|j}|jtj	ddƒsh||_dS|j||_|j
ƒs€dS||_|j|jkr–dS|j}|j|_|j|_|jtj
ƒ}|dkrÊ||_dS|j|_||_|dkr(|j|j}y|jdƒstƒ‚dStk
rYnX|j||_|j
ƒs6dSdS)	NFÚtr,r/rrrYT)r4r1r8r9rEr<r0r=rr3r@r2r:Úa_9rF)r5rArJrXrBÚv_6r6r6r7Z__r_t_pluralmsP


zFinnishStemmer.__r_t_pluralc0Cs|j|jkrdS|j}|j|_|j|j}yf|j|j}|jƒsFtƒ‚|j||_|j|_|j|jkrltƒ‚|jd8_|j|_|jƒsŽdSWntk
r¤YnX|j||_|j|j}yP|j|_|j	t
jddƒsÞtƒ‚|j|_|j	t
j
ddƒsþtƒ‚|jƒsdSWntk
r$YnX|j||_|j|j}y®|j|_|jdƒsZtƒ‚|j|_yb|j|j}y|jdƒs„tƒ‚tƒ‚Wntk
r¢YnX|j||_|jd	ƒsÂtƒ‚Wntk
rÚYnX|jƒsêdSWntk
rYnX|j||_|j|j}yF|j|_|jdƒs8tƒ‚|j|_|jdƒsRtƒ‚|jƒs`dSWntk
rxYnX|j||_||_|jt
jdd
ƒs¢dS|j|_|j	t
j
ddƒsÀdS|j|_|jƒ|_|jdkrâdS|j|jƒsôdS|jƒsdSdS)
NFrr,éärPrQr%rNÚur/r.T)r4r1r8r0rrFr9r<r@r=rÚg_AEIrTrUrErSÚlab4Úlab3Úlab5Zgo_in_grouping_br3Zslice_toÚS_x)r5rArJrWrXr^Úv_7Úv_8r6r6r7Z__r_tidy˜sª






zFinnishStemmer.__r_tidyc	Cs^|j}|jƒ||_d|_|j|_|j|_|j|j}|jƒ|j||_|j|j}|jƒ|j||_|j|j}|jƒ|j||_|j|j}|jƒ|j||_ypy6|jsºt	ƒ‚|j|j}|j
ƒ|j||_tƒ‚Wnt	k
röYnX|j|j}|jƒ|j||_Wntk
r0YnX|j|j}|j
ƒ|j||_|j|_dS)NFT)r4Ú_FinnishStemmer__r_mark_regionsrVr8r0Ú_FinnishStemmer__r_particle_etcÚ_FinnishStemmer__r_possessiveÚ_FinnishStemmer__r_case_endingÚ _FinnishStemmer__r_other_endingsrTÚ_FinnishStemmer__r_i_pluralrFÚ_FinnishStemmer__r_t_pluralÚ_FinnishStemmer__r_tidy)	r5Zv_1rArJrWrXrfrgZv_9r6r6r7Ú_stemîsL
zFinnishStemmer._stemNéÿÿÿÿrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrq)$Ú__name__Ú
__module__Ú__qualname__Ú__doc__rr;rGrHrIrDrKrRrZr[r]rarUr3rLr>rVrer2r1rhr?rirjrrrkrlrmrnrorpr6r6r6r7rsÜ









































































&***9@+Vrc@seZdZdS)rFN)rrrsrtr6r6r6r7rFsrFc@seZdZdS)rTN)rrrsrtr6r6r6r7rTsrTc@seZdZdS)rSN)rrrsrtr6r6r6r7rSsrSc@seZdZdS)rcN)rrrsrtr6r6r6r7rcsrcc@seZdZdS)rbN)rrrsrtr6r6r6r7rb!srbc@seZdZdS)rdN)rrrsrtr6r6r6r7rd$srdN)ZbasestemmerrZamongrrÚ
BaseExceptionrFrTrSrcrbrdr6r6r6r7Ú<module>s