+
   xcc                   s   ^ RI Ht ^ RI Ht ^ RI Ht ^ RI Ht ^ RI Ht ^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RIt]
P                  ! R4      t]! ^ 4      sRtRt ^ RItR	tRt ^ RItR	t^dt ! R
 R4      t ! R R4      tR	tR R lt]R8X  d
   ]! 4        R# R#   ]3 d     ^ RItR	t LJ  ]3 d      LUi ; ii ; i  ]3 d     L^i ; i)    )Dict)Tuple)List)Iterable)AnyNzibus-typing-boosterFTc                   sH  a a ] tR t^Ft o/ tRV3R lV 3R llltRV3R lR lltV3R lR ltV3R lR ltV3R	 lR
 lt	V3R lR lt
V3R lR ltV3R lR ltV3R lR ltV3R lR ltV3R lR lt]P"                  ! RR7      V3R lR l4       tV3R ltRtVtV ;t# )
Dictionaryc                s,   < V ^8  d   QhRS[ RS[RS[ /# )   clsnamereturn)r   strformat__classdict__   "9/usr/share/ibus-typing-booster/engine/hunspell_suggest.py__annotate__Dictionary.__annotate__Q   s"     # #S # ## #    c                s   < W3pW P                   9  d0   \        SV `	  V 4      pW0P                   V&   VP                  VR 7       V P                   V,          # )r	   )
_instancesZsuper__new___initialize)r   r	   keyZinstance	__class__s   &&  r   r   ZDictionary.__new__Q   sN    knn$ws+H"*NN3  d +~~c""r   c                s$   < V ^8  d   QhRS[ RR/# )r   r	   r
   N)r   r   r   r   r   r   Z   s     # # #$ #r   c                sX   \         ^8  d   \        P                  RV4       Wn        V P                  P	                  R4      ^ ,          V n        RV n        RV n        . V n        . V n	        ^ V n
        RV n        RV n        RV n        V P                  R8w  d   V P                  4        R# R# )   zname=%s_Z UTF-8NZNone)DEBUG_LEVELLOGGERdebugr	   splitlanguagedic_pathencodingwords
word_pairsmax_word_lenenchant_dictpyhunspell_objectvoikkoload_dictionary)selfr	      &&r   r   ZDictionary._initializeZ   s    ?LLD)			,Q/!
13 !%(,99  " r   c                   < V ^8  d   QhRR/# r   r
   N r   r   r   r   r   k   s     G2 G2 G2r   c           	     s>	   \         ^ 8  d   \        P                  R4       \        P                  ! V P
                  4      w  V n        V n        V n        V P                  '       Edp   V P                  \        P                  9   dY   V P                   Uu. uF<  pV\        P                  ! V\        P                  V P                  ,          R7      3NK>  	  upV n        V P                   F'  p\        V P                  \        V4      4      V n        K)  	  \         ^8  d!   \        P                  RV P                  4       V P
                  P!                  R4      ^ ,          R8X  dW   RV n        RV n        RV n        \(        '       g   \        P+                  R4       R#  \,        P.                  ! R4      V n        R# \6        '       d   \8        P:                  ! 4       pVP=                  V P
                  R	4        VP?                  V P
                  4      V n        \         ^8  dH   V P"                  e8   \        P                  R
V P
                  V P"                  P@                  4       R# R# R# \J        '       dZ   V P                  '       dF   V P                  PM                  RR4      p \N        PP                  ! V P                  V4      V n        R# R# R# R# u upi   \,        P0                  3 d>   p\        P+                  RTP2                  P4                  T4       RT n         Rp?R# Rp?ii ; i  \8        PB                  PD                   dI   p\        PG                  RT P
                  TP2                  P4                  T4       RT n         Rp?R# Rp?i\H         dI   p\        PG                  RT P
                  TP2                  P4                  T4       RT n         Rp?R# Rp?ii ; i  \N        PR                   dI   p\        P                  RT P
                  TP2                  P4                  T4       RT n         Rp?R# Rp?i\H         dI   p\        P                  RT P
                  TP2                  P4                  T4       RT n         Rp?R# Rp?ii ; i)r    zload_dictionary() ...
Zkeepzmax_word_len = %s
r   ZfiNu7   Language is “fi” but “import libvoikko” failed.zInit of voikko failed: %s: %szhunspell,nuspell,aspell,voikkoz%s: %rz)Error initializing enchant for %s: %s: %sz4Unexpected error initializing enchant for %s: %s: %sz.dicz.affz*Error initializing hunspell for %s: %s: %sz5Unexpected error initializing hunspell for %s: %s: %s)*r   r   r   itb_utilZ get_hunspell_dictionary_wordlistr	   r"   r#   r$   r!   ACCENT_LANGUAGESremove_accentsr%   Zmaxr&   lenr    r'   r(   r)   IMPORT_LIBVOIKKO_SUCCESSFULZwarning	libvoikkoZVoikkoZVoikkoExceptionr   __name__IMPORT_ENCHANT_SUCCESSFULenchantZBrokerZset_orderingZrequest_dictZproviderZerrorsZDictNotFoundErrorZ	exceptionZ	ExceptionIMPORT_HUNSPELL_SUCCESSFULreplacehunspellZHunSpellZHunSpellError)r+   xwordZerrorZbrokerZaff_paths   &     r   r*   ZDictionary.load_dictionaryk   s   
 ?LL23  @@K			:::}} 9 99 "ZZ# ( // 9 9$-- HJ K'#
 

$'(9(93t9$E! #Q)4+<+<>yys#A&$.$(!)-&"22NNQS'"+"2"24"8DK
 (( )##DII/OP-(.(;(;DII(FD%"Q4+<+<+H$dii1B1B1K1KM ,I ,+==00@2 )) MM85 * 1>+[ #( "113 'NN#B#(??#;#;UD"&DKK	' ~~77 -$$C		5??#;#;UD )-D%%  -$$N		5??#;#;UD )-D%%	-  -- 2LLD		5??#;#;UD .2D**  2LL%		5??#;#;UD .2D**2st   AK K ;A.L3 *&O. L032L++L03O+=NO+"O+#=O&&O+.R=QRR=RRc                &   < V ^8  d   QhRS[ RS[/# r   r>   r
   r   boolr   r   r   r   r      s     K Ks Kt Kr   c                s    V P                   '       g   R # V P                   P                  \        P                  ! RV4      4      # FNFC)r'   Zcheckunicodedata	normalizer+   r>   r,   r   spellcheck_enchantZDictionary.spellcheck_enchant   s9           &&{'<'<UD'IJJr   c                r?   r@   rA   r   r   r   r   r      s     + +# +$ +r   c                s    V P                   '       g   R # V P                   P                  \        P                  ! RV4      P	                  V P
                  R4      4      # )FrD   r;   )r(   spellrE   rF   encoder#   rG   r,   r   spellcheck_pyhunspellZ Dictionary.spellcheck_pyhunspell   sR     %%% %%++!!%.55y*+ 	+r   c                r?   r@   rA   r   r   r   r   r      s     
K 
Kc 
Kd 
Kr   c                s    V P                   '       g   R # \        V P                   P                  \        P                  ! RV4      4      4      # rC   )r)   rB   rI   rE   rF   rG   r,   r   spellcheck_voikkoZDictionary.spellcheck_voikko   s7     {{{DKK%%k&;&;E4&HIJJr   c                r?   r@   rA   r   r   r   r   r      s      s t r   c                s    V P                   '       d   V P                  V4      # V P                  '       d   V P                  V4      # V P                  '       d%   \        V P                  P                  V4      4      # R # )F)r'   rH   r(   rK   r)   rB   rI   rG   r,   r   
spellcheckZDictionary.spellcheck   sd    * **400!!!--d33;;;))$/00r   c                s    < V ^8  d   QhRS[ /# r   r
   )rB   r   r   r   r   r      s      4 r   c                sv    V P                   '       g%   V P                  '       g   V P                  '       d   R # R# )TF)r'   r(   r)   r+      &r   has_spellcheckingZDictionary.has_spellchecking   s)    (  6 6 6$+++r   c                6   < V ^8  d   QhRS[ RS[S[ ,          /# r@   r   r   r   r   r   r   r     s      s tCy r   c                
   V'       d   V P                   '       g   . # V P                   P                  \        P                  ! R V4      4       Uu. uF(  p\        P                  ! \        P
                  V4      NK*  	  up# u upi rD   )r'   suggestrE   rF   r1   NORMALIZATION_FORM_INTERNALr+   r>   r=      && r   spellcheck_suggest_enchantZ%Dictionary.spellcheck_suggest_enchant  s{     4,,,I %%k&;&;E4&HI	 J  !!44a9 J	 	    .B c                rR   r@   rS   r   r   r   r   r   %  s      # $s) r   c                s>   V'       d   V P                   '       g   . # V P                   P                  \        P                  ! R V4      P	                  V P
                  R4      4       Uu. uF(  p\        P                  ! \        P                  V4      NK*  	  up# u upi )rD   r;   )r(   rV   rE   rF   rJ   r#   r1   rW   rX   rY   r   spellcheck_suggest_pyhunspellZ(Dictionary.spellcheck_suggest_pyhunspell%  s     4111I ""**%%eT299MM9./	/  !!44a9/	 	 s   ).Bc                rR   r@   rS   r   r   r   r   r   8  s      c d3i r   c                rT   rU   )r)   rV   rE   rF   r1   rW   rX   rY   r   spellcheck_suggest_voikkoZ$Dictionary.spellcheck_suggest_voikko8  sv     4;;;I
 KK 5 5eT BC	 D  !!44a9 D	 	 r[     Zmaxsizec                rR   r@   rS   r   r   r   r   r   V  s        s  tCy  r   c                s    V P                   '       d   V P                  V4      # V P                  '       d   V P                  V4      # V P                  '       d   V P                  V4      # . # N)r'   rZ   r(   r\   r)   r]   rG   r,   r   spellcheck_suggestZDictionary.spellcheck_suggestU  s]    6 22488!!!55d;;;;;11$77	r   c                sR   < V ^8  d   Qh/ S[ S[S[S[3,          S[3,          ;R&   # )r   r   )r   r   r   r   r   r   r   r   r   F   s$      U38_c)*/ r   )
r"   r'   r#   r!   r&   r	   r(   r)   r%   r$   )Zen_US)r7   
__module____qualname____firstlineno__r   r   r   r*   rH   rK   rL   rM   rQ   rZ   r\   r]   	functools	lru_cachera   Z__annotate_func____static_attributes____classdictcell__Z__classcell__)r   r   s   @@r   r   r   F   s      .0J# ## #"G2 G2RK K+ +
K 
K : 0 ( & : )  * a  r   r   c                   s   a  ] tR tRt o RV 3R lR lltV 3R lR ltV 3R lR ltV 3R lR	 ltV 3R
 lR ltV 3R lR lt	RV 3R lR llt
]P                  ! RR7      V 3R lR l4       tRtV tR# )Hunspelliy  c                4   < V ^8  d   QhRS[ S[,          RR/# r   dictionary_namesr
   N)r   r   r   r   r   r   Hunspell.__annotate__}  s     ! !# ! !r   c                sv    \        \        \        P                  ! R 4      4      4      s\        ^8  d5   V'       d   \        P                  RV4       M\        P                  R4       / V n	        \        V4      V n        . V n        V P                  4        R#   \
        \        3 d    \        ^ 4      s Li ; i)ZIBUS_TYPING_BOOSTER_DEBUG_LEVELz'Hunspell.__init__(dictionary_names=%s)
z'Hunspell.__init__(dictionary_names=())
N)intr   osZgetenvr   Z	TypeErrorZ
ValueErrorr   r   _suggest_cachelist_dictionary_names_dictionariesinit_dictionaries)r+   rl   r,   r   __init__ZHunspell.__init__}  s    	!BII?@ACK ?>$& GH@B,01A,B/1  :& 	!a&K	!s   (B B87B8c                r-   r.   r/   r   r   r   r   rm     s     H H4 Hr   c                s^   \         ^8  dI   V P                  '       d"   \        P                  RV P                  4       M\        P                  R4       V P                  P                  4        . V n        V P                   F(  pV P                  P                  \        VR7      4       K*  	  R# )r   z1Hunspell.init_dictionaries() dictionary_names=%s
z1Hunspell.init_dictionaries() dictionary_names=()
r   N)	r   rr   r   r   rV   Zcache_clearrs   appendr   )r+   Zdictionary_name   & r   rt   ZHunspell.init_dictionaries  s     ?%%%H**, HJ  "#55O%%jo&FG  6r   c                s0   < V ^8  d   QhRS[ S[,          /# rN   r   r   r   r   r   r   rm     s     / /d3i /r   c                s:    \        V P                  R ,          4      # ):NNN)rq   rr   rO   rP   r   get_dictionary_namesZHunspell.get_dictionary_names  s    
 D**1-..r   c                rj   rk   rx   r   r   r   r   rm     s     6 6T#Y 64 6r   c                s   WP                   8w  d   \        V4      \        V P                   4      8w  d   Wn         V P                  4        MNWn         . pV F:  pV P                   F'  pVP                  V8X  g   K  VP                  V4       K)  	  K<  	  W n        \        ^8  dL   \        P                  RV4       V P                   F#  p\        P                  RVP                  4       K%  	  R# R# )r   zset_dictionary_names(%s):
z%s
N)	rr   Zsetrt   rs   r	   rv   r   r   r   )r+   rl   Zdictionaries_newr	   
dictionary   &&   r   set_dictionary_namesZHunspell.set_dictionary_names  s     555#$D,B,B(CC)9&&&(
 *:&#% ,D&*&8&8
%??d2,33J? '9 - &6"?LL68HI"00
VZ__5 1 r   c                r?   r   input_phraser
   rA   r   r   r   r   rm     s     6 6s 6t 6r   c                s    R V9   d   R# RpRpV P                    F4  pVP                  4       '       g   K  RpW4P                  V4      ,          pK6  	  V'       g   V'       d   R# R# )Z TF)rs   rQ   rM   )r+   r~   Z$spellchecking_dictionaries_availablespellcheck_totalrz   r{   r   rM   ZHunspell.spellcheck  sc    X ,/4, ,,J++--7;4 $9$9,$GG  -  $Hr   c                rR   r}   rS   r   r   r   r   rm     s      # $s) r   c                s    . pVP                  4       '       g   . # V P                   F7  pVP                  V4      '       g   K  VP                  VP                  4       K9  	  V# r`   )Zstriprs   rM   rv   r	   )r+   r~   Z
match_listrz   s   &&  r   spellcheck_match_listZHunspell.spellcheck_match_list  sX    ( 
!!##I,,J$$\22!!*//2 - r   c                sF   < V ^8  d   QhRS[ S[,          RS[S[,          /# )r   r$   r
   )r   r   r   r   r   r   r   rm     s'     A( A((3- A(c A(r   c                s   V'       g   . # V F  pV'       d   K  . u # 	  . pV P                    FJ  pR pV F  pWTP                  V4      ,          pK  	  V'       g   K/  VP                  VP                  4       KL  	  \	        V4      # )T)rs   rM   rv   r	   sorted)r+   r$   r>   rl   rz   r   s   &&    r   spellcheck_single_dictionaryZ%Hunspell.spellcheck_single_dictionary  s    j ID4	  ,,J# $9$9$$??   ''
8 - &''r   r^   r_   c                sL   < V ^8  d   QhRS[ RS[S[S[ S[3,          ,          /# r}   )r   r   r   rn   r   r   r   r   rm   g  s,     h" h"C h"DsCx,A h"r   c           	     s   \         ^8  d(   \        P                  RRVP                  R4      /4       V'       d   RV9   d   . # \        P
                  ! \        P                  V4      p/ pV P                   EF  pVP                  p/ W$&   VP                  '       g   K(  VP                  '       d8   \        P                  ! V\        P                  VP                  ,          R7      p\        V4      VP                   8:  d   VP                  '       dY   XP#                  4       pVP                   F7  w  rxVP#                  4       P%                  V4      '       g   K,  ^ W$,          V&   K9  	  MUVP#                  4       pVP                   F5  pVP#                  4       P%                  V4      '       g   K*  ^ W$,          V&   K7  	  \        V4      ^8  g   EK]  VP'                  V4      '       d   ^ W$,          V&   \)        W$,          4      R,           U	U
u/ uF7  p	VP+                  V	4       F  p
V
P%                  V	4      '       g   K  V
^ bK!  	  K9  	  pp	p
W$,          P-                  V4       R VP+                  V4       4       p\/        V4       F  w  rWV,          9  g   K  VP                  '       dJ   \        P                  ! V	\        P                  VP                  ,          R7      X8X  d   ^ W$,          V	&   Ko  V^,           ) W$,          V	&   K  	  EK  	  \        P0                  ! VP3                  4       !  p\)        VP5                  4       R R	7      ^ \6         pV# u up
p	i )
r   z'Hunspell.suggest() input_phrase=%(ip)s
Zipr   Z/r0   :r    i   Nc              3   sl   "   T F*  p\         P                  ! \        P                  V4      x  K,  	  R # 5ir`   )rE   rF   r1   rW   )Z.0r=   rw   r   Z	<genexpr>Z#Hunspell.suggest.<locals>.<genexpr>  s=      ) D  $--$@@!E E Ds   24c                 sJ    V ^,          ) \        V ^ ,          4      V ^ ,          3# )r   )r4   )r=   rP   r   Z<lambda>Z"Hunspell.suggest.<locals>.<lambda>
  s"    A$AaD	!r   )r   )r   r   r   rJ   rE   rF   r1   rW   rs   r	   r$   r%   r3   r2   r!   r4   r&   ZcasefoldZ
startswithrM   r   ra   ZupdateZ	enumerateZmerge_dicts_maxZvaluesZitems	MAX_WORDS)r+   r~   Zsuggested_wordsrz   r	   Zinput_phrase_no_accentsZqueryr>   ZstrippedZ
suggestionr=   Zsuffixed_suggestionsZextra_suggestionsZindexZsuggested_words_totalZsorted_suggestionss   &&              r   rV   ZHunspell.suggestf  s   Z ?LL:|**7346 sl2I",,00,@ 68,,J??D$&O!(((.6.E.E$%66z7J7JK/M+ |$
(?(??!,,, 7 @ @ B.8.C.CND'002==eDD>? 5d ; /D !- 5 5 7$.$4$4D#}}99%@@>? 5d ; %5 |$)!,,\:: ?@-l;
 +11F*G*L,*LJ!+!>!>z!JA<<
3 1!J *L ) , $)001EF) #55lC	)% .77H-I)%T-BB * 5 5 5 ( 7 7$.)1)B)B(2(;(;*=!> $;	!;
 EF 5j AFKaiL 5j A .Jc -z !) 8 8##%!'#!'')  "!E,s   -MM)rs   rr   rp   N)r/   )r7   rb   rc   rd   ru   rt   ry   r|   rM   r   r   re   rf   rV   rg   rh   )r   s   @r   ri   ri   y  sr     ! !&H H / /6 666 6p 8A( A(` )h" *h"r   ri   c                s    V ^8  d   QhRR/# r.   r/   )r   s   "r   r   r     s     % %d %r   c                  s   \         P                  ! \        P                  R 7      p \         P                  ! R4      pV P                  V4       \        P                  \         P                  4       \        P                  V 4       \        '       d)   ^ RIp^ RIpVP                  4       pVP                  4        ^ RIpVP!                  4       w  rg\        '       dg   XP#                  4        XP%                  V4      pVP'                  4        VP)                  R4       VP+                  R^4       VP+                  R^4       \        P-                  R\.        P0                  P3                  4       4       \        P4                  ! V4       R# ))ZstreamzP%(asctime)s %(filename)s line %(lineno)d %(funcName)s %(levelname)s: %(message)sNZ
cumulativer<   r9   z(itb_util.remove_accents() cache info: %s)loggingZStreamHandlersysZstderrZ	FormatterZsetFormatterr   ZsetLevelZDEBUGZ
addHandler	BENCHMARKcProfilepstatsZProfileZenabledoctestZtestmodZdisableZStatsZ
strip_dirsZ
sort_statsZprint_statsZinfor1   r3   Z
cache_infoZexit)	Zlog_handlerZlog_formatterr   r   Zprofiler   ZfailedZ
_attemptedZstatss	            r   mainr     s    ''szz:K%%	M ]+
OOGMM"
k"y""$"??,VyW%&*b))R(
KK:''2246 HHVr   Z__main__)Ztypingr   r   r   r   r   ro   r   rE   re   r   r1   Z	getLoggerr   rn   r   r8   r:   r9   ZImportErrorr<   r5   r6   r   r   ri   r   r   r7   r/   r   r   <module>r      s   4      	 
    			0	1!f! "  $ $ 	"& 	p pf	V" V"p 	%N zF W 	~ %)"> 	 	~ 		s<   B B9 B6B&&B2.B61B22B69CC