+
     h  c                   sH    R t ^ RIHt ^ RItR tRR ltRR ltR.]n        R# )a  

enchant.utils:    Misc utilities for the enchant package
========================================================

This module provides miscellaneous utilities for use with the
enchant spellchecking package.  Currently available functionality
includes:

    * functions for dealing with locale/language settings
    * ability to list supporting data files (win32 only)
    * functions for bundling supporting data files from a build

)ErrorNc           	     s   \        V 4      \        V4      8  d   \        W4      # V '       g   \        V4      # \        \        V4      ^,           4      p\        V 4       Fv  w  r4V^,           .p\        V4       FV  w  rgW&^,           ,          ^,           pWV,          ^,           p	W&,          WG8g  ,           p
VP	                  \        WV
4      4       KX  	  TpKx  	  VR,          # )zZCalculate the Levenshtein distance between two strings.

This is straight from Wikipedia.
i)ZlenlevenshteinZrangeZ	enumerateZappendZmin)Zs1Zs2Zprevious_rowZiZc1Zcurrent_rowZjZc2Z
insertionsZ	deletionsZsubstitutionss   &&         2/usr/lib/python3.14/site-packages/enchant/utils.pyr   r   1   s    
 2wR2""2wR1%L21ugr]EA%!e,q0J#*I(Orx8Ms:-HI	 #
 #      c                s    Vf   \         pV Uu. uF  qC! W4      V3NK  	  ppVP                  4        VRV  UUu. uF  w  rdVNK	  	  upp# u upi u uppi )a  Trim a list of suggestions to a maximum length.

If the list of suggested words is too long, you can use this function
to trim it down to a maximum length.  It tries to keep the "best"
suggestions based on similarity to the original word.

If the optional "calcdist" argument is provided, it must be a callable
taking two words and returning the distance between them.  It will be
used to determine which words to retain in the list.  The default is
a simple Levenshtein distance.
N)r   Zsort)ZwordZsuggsZmaxlenZcalcdistZsZ	decoratedZls   &&&&   r   trim_suggestionsr   H   s_     167A(4#Q'I7NN%gv./.&1A.// 8/s
   AAc                s     \         P                  ! 4       ^ ,          pVf,   \         P                  ! 4       ^ ,          pVf   \        R4      hV#   \         d     T # i ; i)a@  Determine the user's default language, if possible.

This function uses the 'locale' module to try to determine
the user's preferred language.  The return value is as
follows:

    * if a locale is available for the LC_MESSAGES category,
      that language is used
    * if a default locale is available, that language is used
    * if the keyword argument <default> is given, it is used
    * if nothing else works, None is returned

Note that determining the user's language is in general only
possible if they have set the necessary environment variables
on their system.
zNo default language available)localeZ	getlocaleZgetdefaultlocaler    Z	Exception)ZdefaultZtags   & r   get_default_languager   [   s_    " #;))+A.C{;<<
 Ns   AA AAZLC)N)Z__doc__Zenchant.errorsr    r   r   r   r   Z_DOC_ERRORS) r   r   <module>r      s.   < ! .0&: %)6   r   