3

U'ícÊ$ã@sGdd„deƒZdS)c@sÔeZdZdd„Zdd„Zdd„Zdd„Zd	d
„Zdd„Zd
d„Z	dd„Z
dd„Zdd„Zdd„Z
dd„Zdd„Zdd„Zdd„Zdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„Zd)d*„Zd+d,„Zd-d.„Zd/d0„Zd1d2„Zd3S)4ÚBaseStemmercCs|jdƒdS)NÚ)Úset_current)Úself©rúF/tmp/pip-build-gk9425m9/snowballstemmer/snowballstemmer/basestemmer.pyÚ__init__szBaseStemmer.__init__cCs2||_d|_t|jƒ|_d|_|j|_|j|_dS)z.
        Set the self.current string.
        éN)ÚcurrentÚcursorÚlenÚlimitÚlimit_backwardÚbraÚket)rÚvaluerrrrszBaseStemmer.set_currentcCs|jS)z.
        Get the self.current string.
        )r	)rrrrÚget_currentszBaseStemmer.get_currentcCs4|j|_|j|_|j|_|j|_|j|_|j|_dS)N)r	r
rr
rr)rÚotherrrrÚ	copy_fromszBaseStemmer.copy_fromcCsn|j|jkrdSt|j|jƒ}||ks0||kr4dS||8}||d?d|d@>@dkr\dS|jd7_dS)NFééérT)r
rÚordr	)rÚsÚminÚmaxÚchrrrÚin_groupingszBaseStemmer.in_groupingcCspxj|j|jkrjt|j|jƒ}||ks.||kr2dS||8}||d?d|d@>@dkrZdS|jd7_qWdS)NTrrrrF)r
rrr	)rrrrrrrrÚgo_in_grouping*szBaseStemmer.go_in_groupingcCsr|j|jkrdSt|j|jdƒ}||ks4||kr8dS||8}||d?d|d@>@dkr`dS|jd8_dS)NFrrrrT)r
r
rr	)rrrrrrrrÚ
in_grouping_b5szBaseStemmer.in_grouping_bcCstxn|j|jkrnt|j|jdƒ}||ks2||kr6dS||8}||d?d|d@>@dkr^dS|jd8_qWdS)NrTrrrF)r
r
rr	)rrrrrrrrÚgo_in_grouping_bAszBaseStemmer.go_in_grouping_bcCs||j|jkrdSt|j|jƒ}||ks0||krB|jd7_dS||8}||d?d|d@>@dkrx|jd7_dSdS)NFrTrrr)r
rrr	)rrrrrrrrÚout_groupingLszBaseStemmer.out_groupingcCshxb|j|jkrbt|j|jƒ}||krR||krR||8}||d?d|d@>@rRdS|jd7_qWdS)NrrrTF)r
rrr	)rrrrrrrrÚgo_out_groupingYszBaseStemmer.go_out_groupingcCs€|j|jkrdSt|j|jdƒ}||ks4||krF|jd8_dS||8}||d?d|d@>@dkr||jd8_dSdS)NFrTrrr)r
r
rr	)rrrrrrrrÚout_grouping_bcszBaseStemmer.out_grouping_bcCslxf|j|jkrft|j|jdƒ}||krV||krV||8}||d?d|d@>@rVdS|jd8_qWdS)NrrrTF)r
r
rr	)rrrrrrrrÚgo_out_grouping_bpszBaseStemmer.go_out_grouping_bcCsP|j|jt|ƒkrdS|j|j|jt|ƒ…|kr:dS|jt|ƒ7_dS)NFT)rr
rr	)rrrrrÚeq_szszBaseStemmer.eq_scCsP|j|jt|ƒkrdS|j|jt|ƒ|j…|kr:dS|jt|ƒ8_dS)NFT)r
r
rr	)rrrrrÚeq_s_b‚szBaseStemmer.eq_s_bcCsvd}t|ƒ}|j}|j}d}d}d}xÌ|||d?}	d}
t||ƒ}||	}x\t|t|jƒƒD]H}
|||krtd}
Pt|j||ƒt|j|
ƒ}
|
dkržP|d7}q^W|
dkr¼|	}|}n|	}|}||dkr&|dkrÚP||kräP|rêPd}q&Wx~||}|t|jƒkr\|t|jƒ|_|jdkr.|j	St
||jƒ}|ƒ}|t|jƒ|_|r\|j	S|j}|dkrôdSqôWdS)NrFrTéÿÿÿÿr&)rr
rrÚrangerrr	ÚmethodÚresultÚgetattrÚsubstring_i)rÚvÚiÚjÚcÚlÚcommon_iÚcommon_jÚfirst_key_inspectedÚkÚdiffÚcommonÚwÚi2r(ÚresrrrÚ
find_amongŠs`
 zBaseStemmer.find_amongcCsŠd}t|ƒ}|j}|j}d}d}d}xÜ|||d?}	d}
t||ƒ}||	}xjtt|jƒd|ddƒD]L}
|||kr~d}
Pt|j|d|ƒt|j|
ƒ}
|
dkr¬P|d7}qhW|
dkrÊ|	}|}n|	}|}||dkr&|dkrèP||kròP|rúPd}q&Wx‚||}|t|jƒkrl|t|jƒ|_|jdkr>|j	St
||jƒ}|ƒ}|t|jƒ|_|rl|j	S|j}|dkrdSqWd	S)
zO
        find_among_b is for backwards processing. Same comments apply
        rFrTNr&r&r&r&)rr
r
rr'rrr	r(r)r*r+)rr,r-r.r/Zlbr1r2r3r4r5r6r7r8r(r9rrrÚfind_among_bÄs`
 $

zBaseStemmer.find_among_bcCsnt|ƒ||}|jd|…||j|d…|_|j|7_|j|krZ|j|7_n|j|krj||_|S)z®
        to replace chars between c_bra and c_ket in self.current by the
        chars in s.

        @type c_bra int
        @type c_ket int
        @type s: string
        rN)rr	rr
)rÚc_braÚc_ketrÚ
adjustmentrrrÚ	replace_sþs	"

zBaseStemmer.replace_scCs:|jdks2|j|jks2|j|jks2|jt|jƒkr6dSdS)NrFT)rrrrr	)rrrrÚslice_checks2zBaseStemmer.slice_checkcCs&d}|jƒr"|j|j|j|ƒd}|S)z 
        @type s string
        FT)r@r?rr)rrr)rrrÚ
slice_froms
zBaseStemmer.slice_fromcCs
|jdƒS)Nr)rA)rrrrÚ	slice_delszBaseStemmer.slice_delcCsB|j|||ƒ}||jkr&|j|7_||jkr>|j|7_dS)zQ
        @type c_bra int
        @type c_ket int
        @type s: string
        N)r?rr)rr<r=rr>rrrÚinsert"s


zBaseStemmer.insertcCs"d}|jƒr|j|j|j…}|S)z/
        Return the slice as a string.
        r)r@r	rr)rr)rrrÚslice_to.szBaseStemmer.slice_tocCs|jd|j…S)z<
        Return the current string up to the limit.
        r)r	r)rrrrÚ	assign_to7szBaseStemmer.assign_tocCs|j|ƒ|jƒ|jƒS)N)rZ_stemr)rÚwordrrrÚstemWord=s
zBaseStemmer.stemWordcs‡fdd„|DƒS)Ncsg|]}ˆj|ƒ‘qSr)rG)Ú.0rF)rrrú
<listcomp>Csz)BaseStemmer.stemWords.<locals>.<listcomp>r)rÚwordsr)rrÚ	stemWordsBszBaseStemmer.stemWordsN)Ú__name__Ú
__module__Ú__qualname__rrrrrrrrr r!r"r#r$r%r:r;r?r@rArBrCrDrErGrKrrrrrs2



::
	rN)ÚobjectrrrrrÚ<module>s