+
     h΃  c                   s   R t . ROtRt^ RIt^ RIt ^ RIHt ^ RIHtHt ^ RIHt ^ RIHt  ! R	 R
4      t ! R R4      t ! R R]4      t ! R R]4      t ! R R]4      t]! 4       t]P0                  t]P2                  t]P4                  t]P6                  t]P8                  t]P:                  t]P<                  tR tR t R t!R#   ] d)    ]P                  P                  RR4      '       g   h Rt Li ; i)a?  
enchant:  Access to the enchant spellchecking library
=====================================================

This module provides several classes for performing spell checking
via the Enchant spellchecking library.  For more details on Enchant,
visit the project website:

    https://abiword.github.io/enchant/

Spellchecking is performed using 'Dict' objects, which represent
a language dictionary.  Their use is best demonstrated by a quick
example::

    >>> import enchant
    >>> d = enchant.Dict("en_US")   # create dictionary for US English
    >>> d.check("enchant")
    True
    >>> d.check("enchnt")
    False
    >>> d.suggest("enchnt")
    ['enchant', 'enchants', 'enchanter', 'penchant', 'incant', 'enchain', 'enchanted']

Languages are identified by standard string tags such as "en" (English)
and "fr" (French).  Specific language dialects can be specified by
including an additional code - for example, "en_AU" refers to Australian
English.  The later form is preferred as it is more widely supported.

To check whether a dictionary exists for a given language, the function
'dict_exists' is available.  Dictionaries may also be created using the
function 'request_dict'.

A finer degree of control over the dictionaries and how they are created
can be obtained using one or more 'Broker' objects.  These objects are
responsible for locating dictionaries for a specific language.

Note that unicode strings are expected throughout the entire API.
Bytestrings should not be passed into any function.

Errors that occur in this module are reported by raising subclasses
of 'Error'.

z3.2.2N)_enchantZPYENCHANT_IGNORE_MISSING_LIBF)ErrorDictNotFoundError)get_default_language)PyPWLc                   sH   a  ] tR t^\t o RtR.tR tR tR tR t	R t
RtV tR	# )
ProviderDesca4  Simple class describing an Enchant provider.

Each provider has the following information associated with it:

    * name:        Internal provider name (e.g. "aspell")
    * desc:        Human-readable description (e.g. "Aspell Provider")
    * file:        Location of the library containing the provider

descc                s*    Wn         W n        W0n        R # Nnamer   fileselfr	   r   r
      &&&&5/usr/lib/python3.14/site-packages/enchant/__init__.py__init__ZProviderDesc.__init__i   s    			    c                s(    R V P                   ,          # )z<Enchant: %s>)r   r      &r   __str__ZProviderDesc.__str__n   s    **r   c                s    \        V 4      # r   )Zstrr   r   r   __repr__ZProviderDesc.__repr__q   s    4yr   c                s    V P                   VP                   8H  ;'       d;    V P                  VP                  8H  ;'       d    V P                  VP                  8H  # )z*Equality operator on ProviderDesc objects.r   )r   Zpd   &&r   __eq__ZProviderDesc.__eq__t   s?    yyBGG#UU		RWW(<UUbggAUUr   c                sp    \        V P                  V P                  ,           V P                  ,           4      # )z&Hash operator on ProviderDesc objects.)Zhashr	   r   r
   r   r   r   __hash__ZProviderDesc.__hash__x   s#    DII		)DII566r   )r   r
   r	   N)__name__
__module____qualname____firstlineno____doc___DOC_ERRORSr   r   r   r   r   __static_attributes____classdictcell____classdict__   @r   r   r   \   s2      (K
+V7 7r   r   c                   sd   a  ] tR t^}t o RtR tRR ltR tR]3R lt	R.]	n
        R	 tR
 tRtV tR# )_EnchantObjecta  Base class for enchant objects.

This class implements some general functionality for interfacing with
the '_enchant' C-library in a consistent way.  All public objects
from the 'enchant' module are subclasses of this class.

All enchant objects have an attribute '_this' which contains the
pointer to the underlying C-library object.  The method '_check_this'
can be called to ensure that this point is not None, raising an
exception if it is.
c                sH    RV n         \        e   V P                  4        R# R# )z_EnchantObject constructor.N)_this_e
_init_thisr   r   r   r   Z_EnchantObject.__init__   s    
 >OO r   Nc                s~    V P                   f/   Vf    RpWP                  P                  3,          p\        V4      hR# )z<Check that self._this is set to a pointer, rather than None.Nz<%s unusable: the underlying C-library object has been freed.)r$   	__class__r   r   )r   msgr   r   _check_thisZ_EnchantObject._check_this   s:    ::{T^^4466*	 r   c                s    \         h)z3Initialise the underlying C-library object pointer.)ZNotImplementedErrorr   r   r   r&   Z_EnchantObject._init_this   s    !!r   Unspecified Errorc                s    V! V4      h)a\  Raise an exception based on available error messages.

This method causes an Error to be raised.  Subclasses should
override it to retrieve an error indication from the underlying
API if possible.  If such a message cannot be retrieved, the
argument value <default> is used.  The class of the exception
can be specified using the argument <eclass>
 )r   defaulteclass   &&&r   _raise_errorZ_EnchantObject._raise_error   s     Wor   r-   c                sD    V P                   P                  4       pRVR&   V# )zCustomize pickling of PyEnchant objects.

Since it's not safe for multiple objects to share the same C-library
object, we make sure it's unset when pickling.
Nr$   )__dict__Zcopyr   state   & r   __getstate__Z_EnchantObject.__getstate__   s$     ""$gr   c                s\    V P                   P                  V4       V P                  4        R # r   )r0   Zupdater&   r1   r   r   __setstate__Z_EnchantObject.__setstate__   s    U#r   )r$   r   )r   r   r   r   r   r   r)   r&   r   r/   r   r4   r5   r   r   r    r"   r   r#   r#   }   s@     
" $7u 	 !)zL r   r#   c                   s   a a ] tR t^t oRtV 3R ltR tR tV 3R ltR]	3R lt
R tRR	 ltR
.]n        R tR tR tR tR tR tR tR tR tR tR tR tR.]n        R tR.]n        R tRtVtV ;t# )Brokera]  Broker object for the Enchant spellchecker.

Broker objects are responsible for locating and managing dictionaries.
Unless custom functionality is required, there is no need to use Broker
objects directly. The 'enchant' module provides a default broker object
so that 'Dict' objects can be created directly.

The most important methods of this class include:

    * :py:meth:`dict_exists`:   check existence of a specific language dictionary
    * :py:meth:`request_dict`:  obtain a dictionary for specific language
    * :py:meth:`set_ordering`:  specify which dictionaries to try for a given language.

c                s$   < \         SV `  4        R# )zpBroker object constructor.

This method is the constructor for the 'Broker' object.  No
arguments are required.
N)superr   r   r'      &r   r   ZBroker.__init__   s     	r   c                s    \         P                  ! 4       V n        V P                  '       g   \        R 4      h/ V n        R# )z'Could not initialise an enchant broker.N)r%   Zbroker_initr$   r   _live_dictsr   r   r   r&   ZBroker._init_this   s-    ^^%
zzzABBr   c                X     V P                  4        R#   \        \        3 d     R# i ; i)zBroker object destructor.N_freeZAttributeErrorZ	TypeErrorr   r   r   __del__ZBroker.__del__   '    	JJL	* 		    ))c                sF   < \         SV `  4       pVP                  R 4       V# )r:   )r7   r4   Zpop)r   r2   r'   s   & r   r4   ZBroker.__getstate__   s!    $&		- r   r*   c                    \         P                  ! V P                  4      pVR8X  g   Vf	   V! V4      hV! VP                  4       4      h)z=Overrides _EnchantObject._raise_error to check broker errors. )r%   Zbroker_get_errorr$   decoder   r,   r-   err   &&& r   r/   ZBroker._raise_error   s<    !!$**-"9/!SZZ\""r   c                s   V P                   ez   \        V P                  P                  4       4       F)  w  rV'       g   K  V P	                  V4       V^,          pK&  	  \
        P                  ! V P                   4       RV n         R# R# )a6  Free system resource associated with a Broker object.

This method can be called to free the underlying system resources
associated with a Broker object.  It is called automatically when
the object is garbage collected.  If called explicitly, the
Broker and any associated Dict objects must no longer be used.
N)r$   Zlistr:   Zitems_free_dict_datar%   Zbroker_free)r   dictZcounts   &  r   r=   ZBroker._free   sk     ::! "&d&6&6&<&<&>!?e((.QJE "@ NN4::&DJ "r   c                s    \        W4      # )at  Request a Dict object for the language specified by <tag>.

This method constructs and returns a Dict object for the
requested language.  'tag' should be a string of the appropriate
form for specifying a language, such as "fr" (French) or "en_AU"
(Australian English).  The existence of a specific language can
be tested using the 'dict_exists' method.

If <tag> is not given or is None, an attempt is made to determine
the current language in use.  If this cannot be determined, Error
is raised.

.. note::
    this method is functionally equivalent to calling the Dict()
    constructor and passing in the <broker> argument.

)Dict)r   tagr   r   request_dictZBroker.request_dict   s    $ Cr   frc                s\   V P                  4        \        P                  ! V P                  VP	                  4       4      pVf)   RpVR,          pV P                  W13,          \        4       W P                  9  d   ^V P                  V&   V# V P                  V;;,          ^,          uu&   V# )zRequest raw C pointer data for a dictionary.

This method call passes on the call to the C library, and does
some internal bookkeeping.
z0Dictionary for language '%s' could not be found
z?Please check https://pyenchant.github.io/pyenchant/ for details)r)   r%   Zbroker_request_dictr$   encoder/   r   r:   )r   rJ   new_dicte_str   &&  r   _request_dict_dataZBroker._request_dict_data  s     	))$**cjjlCGEVVEefn.?@+++)*DX&  X&!+&r   c                sv   V P                  4        \        P                  ! V P                  VP	                  4       4      pVf   RpV P                  W13,          4       W P                  9  d   ^V P                  V&   MV P                  V;;,          ^,          uu&   \        R4      pVP                  W 4       V# )a"  Request a Dict object for a personal word list.

This method behaves as 'request_dict' but rather than returning
a dictionary for a specific language, it returns a dictionary
referencing a personal word list.  A personal word list is a file
of custom dictionary entries, one word per line.
z0Personal Word List file '%s' could not be loadedF)	r)   r%   Zbroker_request_pwl_dictr$   rM   r/   r:   rI   _switch_this)r   pwlrN   rO   Zds   &&   r   request_pwl_dictZBroker.request_pwl_dict&  s     	--djj#**,GFEefn-+++)*DX&X&!+&K	x&r   c                sX    V P                  VP                  4       RVn        RVn        R# )zFree memory associated with a dictionary.

This method frees system resources associated with a Dict object.
It is equivalent to calling the object's 'free' method.  Once this
method has been called on a dictionary, it must not be used again.
N)rG   r$   _brokerr   rH   r   r   
_free_dictZBroker._free_dict;  s$     	TZZ(
r   c                s    V P                  4        \        P                  ! V P                  V4       V P                  V;;,          ^,          uu&   V P                  V,          ^ 8X  d   V P                  V R# R# )z'Free the underlying pointer for a dict.N)r)   r%   Zbroker_free_dictr$   r:   rV   r   r   rG   ZBroker._free_dict_dataF  s^    
DJJ-!#D!Q&  & 'r   c                s    V P                  4        \        P                  ! V P                  VP	                  4       4      p\        V4      # )zCheck availability of a dictionary.

This method checks whether there is a dictionary available for
the language specified by 'tag'.  It returns True if a dictionary
is available, and False otherwise.
)r)   r%   Zbroker_dict_existsr$   rM   Zbool)r   rJ   val   && r   dict_existsZBroker.dict_existsN  s6     	##DJJ

=Cyr   c                s    V P                  4        \        P                  ! V P                  VP	                  4       VP	                  4       4       R# )a2  Set dictionary preferences for a language.

The Enchant library supports the use of multiple dictionary programs
and multiple languages.  This method specifies which dictionaries
the broker should prefer when dealing with a given language.  'tag'
must be an appropriate language specification and 'ordering' is a
string listing the dictionaries in order of preference.  For example
a valid ordering might be "aspell,myspell,ispell".
The value of 'tag' can also be set to "*" to set a default ordering
for all languages for which one has not been set explicitly.
N)r)   r%   Zbroker_set_orderingr$   rM   )r   rJ   Zorderingr.   r   set_orderingZBroker.set_orderingY  s3     	
tzz3::<9JKr   c                s    V P                  4        . V n        \        P                  ! V P                  V P
                  4       V P                   Uu. uF  p\        V!  NK  	  up# u upi )zReturn list of provider descriptions.

This method returns a list of descriptions of each of the
dictionary providers available.  Each entry in the list is a
ProviderDesc object.
)r)   _Broker__describe_resultr%   Zbroker_describer$   _Broker__describe_callbackr   r   Zrr3   r   describeZBroker.describeh  sW     	!#
4::t'?'?@*.*@*@A*@Qa *@AAAs   A&c                s    VP                  4       pVP                  4       pVP                  4       pV P                  P                  WV34       R# )zCollector callback for dictionary description.

This method is used as a callback into the _enchant function
'enchant_broker_describe'.  It collects the given arguments in
a tuple and appends them to the list '__describe_result'.
N)rC   r\   appendr   r   r   __describe_callbackZBroker.__describe_callbackt  s>     {{}{{}{{}%%t4&89r   c                s    V P                  4        . V n        \        P                  ! V P                  V P
                  4       V P                   Uu. uF  q^ ,          \        V^,          !  3NK  	  up# u upi )aW  Return list of available dictionaries.

This method returns a list of dictionaries available to the
broker.  Each entry in the list is a two-tuple of the form:

    (tag,provider)

where <tag> is the language lag for the dictionary and
<provider> is a ProviderDesc object describing the provider
through which that dictionary can be obtained.
)r)   _Broker__list_dicts_resultr%   Zbroker_list_dictsr$   _Broker__list_dicts_callbackr   r^   r3   r   
list_dictsZBroker.list_dicts  sb     	#% 
TZZ)C)CD595M5MN5M1|QqT*+5MNNNs   !A5c                s    VP                  4       pVP                  4       pVP                  4       pVP                  4       pV P                  P                  WW4334       R# )zCollector callback for listing dictionaries.

This method is used as a callback into the _enchant function
'enchant_broker_list_dicts'.  It collects the given arguments into
an appropriate tuple and appends them to '__list_dicts_result'.
N)rC   rb   r`   r   rJ   r	   r   r
      &&&&&r   Z__list_dicts_callbackZBroker.__list_dicts_callback  sL     jjl{{}{{}{{}  ''T.@(ABr   c                sn    . pV P                  4        F  w  r#W!9  g   K  VP                  V4       K   	  V# )zList languages for which dictionaries are available.

This function returns a list of language tags for which a
dictionary is available.
)rd   r`   )r   ZlangsrJ   Zprovs   &   r   list_languagesZBroker.list_languages  s5     ??,KSS! - r   c                sR   a . oV3R lp\         P                  ! W4       S^ ,          # )zGet the description tuple for a dict data object.
<dict_data> must be a C-library pointer to an enchant dictionary.
The return value is a tuple of the form:
        (<tag>,<name>,<desc>,<file>)
c                 s   < V P                  4       p VP                  4       pVP                  4       pVP                  4       pSP                  WW#34       R # r   )rC   r`   )rJ   r	   r   r
   	cb_results   &&&&r   cb_funcZ'Broker.__describe_dict.<locals>.cb_func  sB    **,C;;=D;;=D;;=Dc45r   )r%   dict_describe)r   Z	dict_datari   rh   s   && @r   Z__describe_dictZBroker.__describe_dict  s)     		6 	,|r   r   c                s    \         P                  ! V P                  VP                  4       4      pVe   VP	                  4       pV# )a+  Get the value of a named parameter on this broker.

Parameters are used to provide runtime information to individual
provider backends.  See the method :py:meth:`set_param` for more details.

.. warning::

    This method does **not** work when using the Enchant C
    library version 2.0 and above
)r%   Zbroker_get_paramr$   rM   rC   )r   r	   paramrY   r   	get_paramZBroker.get_param  s6     ##DJJ>LLNEr   rk   c                s    VP                  4       pVe   VP                  4       p\        P                  ! V P                  W4       R# )zSet the value of a named parameter on this broker.

Parameters are used to provide runtime information to individual
provider backends.

.. warning::

    This method does **not** work when using the Enchant C
    library version 2.0 and above
N)rM   r%   Zbroker_set_paramr$   )r   r	   Zvaluer.   r   	set_paramZBroker.set_param  s4     {{}LLNE
DJJ4r   )__describe_resultZ__list_dicts_resultr:   r$   r   )r   r   r   r   r   r   r&   r>   r4   r   r/   r=   rK   r   rQ   rT   rW   rG   rZ   r[   r_   r]   rd   rc   rg   Z_Broker__describe_dictrl   rm   r   r   __classcell__r'   r!      @@r   r6   r6      s     
 $7u #$( !%vL$*	'	L
B
:O"C
( $*(O  %II5 5r   r6   c                   s   a a ] tR tRt oRtRV 3R lltR tR tR tR.]n	        RV 3R llt
R	]3R
 ltR tR tR tR tR tR tR tR tR tR tR tRR.]n	        RR ltR tRtVtV ;t# )rI   i  a  Dictionary object for the Enchant spellchecker.

Dictionary objects are responsible for checking the spelling of words
and suggesting possible corrections.  Each dictionary is owned by a
Broker object, but unless a new Broker has explicitly been created
then this will be the 'enchant' module default Broker and is of little
interest.

The important methods of this class include:

    * check():              check whether a word id spelled correctly
    * suggest():            suggest correct spellings for a word
    * add():                add a word to the user's personal dictionary
    * remove():             add a word to the user's personal exclude list
    * add_to_session():     add a word to the current spellcheck session
    * store_replacement():  indicate a replacement for a given word

Information about the dictionary is available using the following
attributes:

    * tag:        the language tag of the dictionary
    * provider:   a ProviderDesc object for the dictionary provider

c                s   < RV n         Vf%   \        4       pVf   RpVR,           p\        V4      hWn        Vf   \        pW n        \
        SV `  4        R# )a  Dict object constructor.

A dictionary belongs to a specific language, identified by the
string <tag>.  If the tag is not given or is None, an attempt to
determine the language currently in use is made using the 'locale'
module.  If the current language cannot be determined, Error is raised.

If <tag> is instead given the value of False, a 'dead' Dict object
is created without any reference to a language.  This is typically
only useful within PyEnchant itself.  Any other non-string value
for <tag> raises Error.

Each dictionary must also have an associated Broker object which
obtains the dictionary information from the underlying system. This
may be specified using <broker>.  If not given, the default broker
is used.
Nz0No tag specified and default language could not zbe determined.)providerr   r   rJ   rU   r7   r   )r   rJ   brokerrE   r'   s   &&& r   r   ZDict.__init__  sW    & ;&(C{H,,Cj >Fr   c                s    R V n         V P                  '       dC   V P                  P                  V P                  4      pV P	                  WP                  4       R # R # r   )r$   rJ   rU   rQ   rR   )r   thisr3   r   r&   ZDict._init_this   sC     
888<<22488<DdLL1 r   c                r;   )zDict object destructor.Nr<   r   r   r   r>   ZDict.__del__(  r?   r@   c                s    \         P                  V 4       Wn        W n        V P	                  RR7      pV^ ,          V n        \        VR,          !  V n        R# )a  Switch the underlying C-library pointer for this object.

As all useful state for a Dict is stored by the underlying C-library
pointer, it is very convenient to allow this to be switched at
run-time.  Pass a new dict data object into this method to affect
the necessary changes.  The creating Broker object (at the Python
level) must also be provided.

This should *never* *ever* be used by application code.  It's
a convenience for developers only, replacing the clunkier <data>
parameter to __init__ from earlier versions.
F)
check_this:i   NNN)rI   r=   r$   rU   _Dict__describerJ   r   rr   )r   rt   rs   r   rF   r   rR   ZDict._switch_this0  sE     	

4
%07$d2h/r   Zinitc                s   < V P                   e   V P                   P                  f   RV n        \        SV `  V4       R# )zExtend _EnchantObject._check_this() to check Broker validity.

It is possible for the managing Broker object to be freed without
freeing the Dict.  Thus validity checking must take into account
self._broker._this as well as self._this.
N)rU   r$   r7   r)   r   r(   r'      &&r   r)   ZDict._check_thisI  s2     <<4<<#5#5#=DJC r   r*   c                rA   )z;Overrides _EnchantObject._raise_error to check dict errors.rB   )r%   Zdict_get_errorr$   rC   rD   rF   r   r/   ZDict._raise_errorT  s<    

+"9/!SZZ\""r   c                s    V P                   eH   V P                  e8   V P                  P                   e   V P                  P                  V 4       R# R# R# R# )zFree the system resources associated with a Dict object.

This method frees underlying system resources for a Dict object.
Once it has been called, the Dict object must no longer be used.
It is called automatically when the object is garbage collected.
N)r$   rU   rW   r   r   r   r=   Z
Dict._free[  sI     ::! ||'DLL,>,>,J''- -K' "r   c                s    V P                  4        \        V4      ^ 8X  d   \        R4      h\        P                  ! V P
                  VP                  4       4      pV^ 8X  d   R# V^ 8  d   R# V P                  4        R# )zCheck spelling of a word.

This method takes a word in the dictionary language and returns
True if it is correctly spelled, and false otherwise.
z$can't check spelling of empty stringTFN)r)   len
ValueErrorr%   Z
dict_checkr$   rM   r/   )r   wordrX   rY   r   checkZ
Dict.checkh  sc     	 t9>CDDmmDJJ6!87r   c                s    V P                  4        \        V4      ^ 8X  d   \        R4      h\        P                  ! V P
                  VP                  4       4      pV Uu. uF  q3P                  4       NK  	  up# u upi )Suggest possible spellings for a word.

This method tries to guess the correct spelling for a given
word, returning the possibilities in a list.
z(can't suggest spellings for empty string)r)   ry   rz   r%   Zdict_suggestr$   rM   rC   )r   r{   suggswrP   r   suggestZDict.suggestz  s_     	 t9>GHH

DKKM:$)*Eq
E***s   A:c                    V P                  4        \        P                  ! V P                  VP	                  4       4       R# ),Add a word to the user's personal word list.N)r)   r%   Zdict_addr$   rM   r   r{   r   r   addZDict.add  s&    
DJJ.r   c                r   )z/Add a word to the user's personal exclude list.N)r)   r%   Zdict_remover$   rM   r   r   r   removeZDict.remove  s&    
tzz4;;=1r   c                s    \         P                  ! R\        ^R7       V P                  4        \        P
                  ! V P                  VP                  4       4       R# )r   z2Dict.add_to_pwl is deprecated, please use Dict.add)ZcategoryZ
stacklevelN)warningsZwarnZDeprecationWarningr)   r%   Zdict_add_to_pwlr$   rM   r   r   r   
add_to_pwlZDict.add_to_pwl  s?    @'	

 	
4::t{{}5r   c                r   )z(Add a word to the session personal list.N)r)   r%   Zdict_add_to_sessionr$   rM   r   r   r   add_to_sessionZDict.add_to_session  s(    
tzz4;;=9r   c                r   )z'Add a word to the session exclude list.N)r)   r%   Zdict_remove_from_sessionr$   rM   r   r   r   remove_from_sessionZDict.remove_from_session  s(    
##DJJ>r   c                    V P                  4        \        P                  ! V P                  VP	                  4       4      # z2Check whether a word is in the personal word list.)r)   r%   Zdict_is_addedr$   rM   r   r   r   is_addedZDict.is_added  s+    

DKKM::r   c                r   z5Check whether a word is in the personal exclude list.)r)   r%   Zdict_is_removedr$   rM   r   r   r   
is_removedZDict.is_removed  s+    !!$**dkkm<<r   c                s    V'       g   \        R4      hV'       g   \        R4      hV P                  4        \        P                  ! V P                  VP                  4       VP                  4       4       R# )aC  Store a replacement spelling for a miss-spelled word.

This method makes a suggestion to the spellchecking engine that the
miss-spelled word <mis> is in fact correctly spelled as <cor>.  Such
a suggestion will typically mean that <cor> appears early in the
list of suggested spellings offered for later instances of <mis>.
z+can't store replacement for an empty stringz)can't store empty string as a replacementN)rz   r)   r%   Zdict_store_replacementr$   rM   )r   misZcorr.   r   store_replacementZDict.store_replacement  sP     JKKHII
!!$**cjjlCJJLIr   r   c                s    V'       d   V P                  4        \        P                  ! V P                  V P                  4       V P
                  # )a  Return a tuple describing the dictionary.

This method returns a four-element tuple describing the underlying
spellchecker system providing the dictionary.  It will contain the
following strings:

    * language tag
    * name of dictionary provider
    * description of dictionary provider
    * dictionary file

Direct use of this method is not recommended - instead, access this
information through the 'tag' and 'provider' attributes.
)r)   r%   rj   r$   _Dict__describe_callback_Dict__describe_result)r   ru   r   r   Z
__describeZDict.__describe  s9     
T%=%=>%%%r   c                s    VP                  4       pVP                  4       pVP                  4       pVP                  4       pWW43V n        R# )zCollector callback for dictionary description.

This method is used as a callback into the _enchant function
'enchant_dict_describe'.  It collects the given arguments in
a tuple and stores them in the attribute '__describe_result'.
N)rC   r   re   rf   r   ra   ZDict.__describe_callback  s=     jjl{{}{{}{{}"%T!8r   )rn   rU   r$   rr   rJ   )NNr   )T)r   r   r   r   r   r   r&   r>   rR   r   r)   r   r/   r=   r|   r   r   r   r   r   r   r   r   r   rv   r   r   r   ro   rp   rq   r   rI   rI     s     2!F20. !'xL	! $7u #.$+/
2
6:
?
;
=
J &+EN!&(9 9r   rI   c                   s   a a ] tR tRt oRt. ROtRV 3R lltRV 3R lltV 3R ltV 3R lt	V 3R lt
R tR	 tR
 tR tR tRtVtV ;t# )DictWithPWLi  ad  Dictionary with separately-managed personal word list.

.. note::
    As of version 1.4.0, enchant manages a per-user pwl and
    exclude list.  This class is now only needed if you want
    to explicitly maintain a separate word list in addition to
    the default one.

This class behaves as the standard Dict class, but also manages a
personal word list stored in a separate file.  The file must be
specified at creation time by the 'pwl' argument to the constructor.
Words added to the dictionary are automatically appended to the pwl file.

A personal exclude list can also be managed, by passing another filename
to the constructor in the optional 'pel' argument.  If this is not given,
requests to exclude words are ignored.

If either 'pwl' or 'pel' are None, an in-memory word list is used.
This will prevent calls to add() and remove() from affecting the user's
default word lists.

The Dict object managing the PWL is available as the 'pwl' attribute.
The Dict object managing the PEL is available as the 'pel' attribute.

To create a DictWithPWL from the user's default language, use None
as the 'tag' argument.
c                s   < \         SV `  W4       Ved   \        P                  P	                  V4      '       g   \        VR4      pVP                  4        ?V P                  P                  V4      V n	        M\        4       V n	        Vee   \        P                  P	                  V4      '       g   \        VR4      pVP                  4        ?V P                  P                  V4      V n        R# \        4       V n        R# )aL  DictWithPWL constructor.

The argument 'pwl', if not None, names a file containing the
personal word list.  If this file does not exist, it is created
with default permissions.

The argument 'pel', if not None, names a file containing the personal
exclude list.  If this file does not exist, it is created with
default permissions.
NZwt)r7   r   ospathZexistsZopenZcloserU   rT   rS   r   pel)r   rJ   rS   r   rs   Zfr'   s   &&&&& r   r   ZDictWithPWL.__init__  s     	%?77>>#&&dO	||44S9DHwDH?77>>#&&dO	||44S9DHwDHr   c                s
  < V P                   f   V P                  4        V P                  f   V P                  4        \        SV `  V4       V P                   P	                  V4       V P                  P	                  V4       R# )z0Extend Dict._check_this() to check PWL validity.N)rS   r=   r   r7   r)   rw   rx   r   r)   ZDictWithPWL._check_this  sZ    88JJL88JJLC S!S!r   c                s   < V P                   e"   V P                   P                  4        RV n         V P                  e"   V P                  P                  4        RV n        \        SV `  4        R# )z,Extend Dict._free() to free the PWL as well.N)rS   r=   r   r7   r8   r9   r   r=   ZDictWithPWL._free)  sJ    88HHNNDH88HHNNDHr   c                s   < V P                   P                  V4      '       d   R# V P                  P                  V4      '       d   R# \        SV `  V4      '       d   R# R# )zCheck spelling of a word.

This method takes a word in the dictionary language and returns
True if it is correctly spelled, and false otherwise.  It checks
both the dictionary and the personal word list.
FT)r   r|   rS   r7   )r   r{   r'   rx   r   r|   ZDictWithPWL.check3  sF     88>>$88>>$7=r   c                sR  < \         SV `  V4      pTP                  V P                  P                  V4       Uu. uF  q3V9  g   K  VNK  	  up4       \	        \        V4      ^,
          RR4       F.  pV P                  P                  W$,          4      '       g   K,  W$ K0  	  V# u upi )r}   i)r7   r   ZextendrS   Zrangery   r   r|   )r   r{   r~   r   Zir'   s   &&   r   r   ZDictWithPWL.suggestB  s     %!1!1$!7J!7AE>aa!7JKs5zA~r2.Axx~~eh''H / 	 Ks   B$B$c                    V P                  4        V P                  P                  V4       V P                  P	                  V4       R# zAdd a word to the associated personal word list.

This method adds the given word to the personal word list, and
automatically saves the list to disk.
N)r)   rS   r   r   r   r   r   r   r   ZDictWithPWL.addO  s0     	Tr   c                r   )z*Add a word to the associated exclude list.N)r)   rS   r   r   r   r   r   r   r   ZDictWithPWL.removeY  s.    Tr   c                r   r   )r)   rS   r   r   r   r   r   r   r   ZDictWithPWL.add_to_pwl_  s2     	D!r   c                X    V P                  4        V P                  P                  V4      # r   )r)   rS   r   r   r   r   r   ZDictWithPWL.is_addedi  #    xx  &&r   c                r   r   )r)   r   r   r   r   r   r   ZDictWithPWL.is_removedn  r   r   )r   rS   )r   r   ZPELr   )NNNr   )r   r   r   r   r   r   r   r)   r=   r|   r   r   r   r   r   r   r   r   ro   rp   rq   r   r   r     sH     8 /K:"'
' 'r   r   c                 H    \         P                  ! 4       P                  4       # )z:Get the version string for the underlying enchant library.)r%   Zget_versionrC   r+   r   r   get_enchant_versionr     s    >>""$$r   c                s.    \         P                  ! V 4      # )zSet the prefix used by the Enchant library to find its plugins

Called automatically when the Python library is imported when
required.
)r%   set_prefix_dirr   )r   r   r   r   r     s     T""r   c                 r   )z]Return the path that will be used by some
Enchant providers to look for custom dictionaries.
)r%   get_user_config_dirrC   r+   r   r   r   r     s     !!#**,,r   )enchntr   ZincantrL   )"r   r   Z__version__r   r   Zenchantr    r%   ZImportErrorZenvironZgetZenchant.errorsr   r   Zenchant.utilsr   Zenchant.pypwlr   r   r#   r6   rI   r   rU   rK   rT   rZ   rd   rg   rl   rm   r   r   r   r+   r   r   <module>r      s	  <*V 3 	 & 4 . 7 7B: :zf5^ f5R	}9> }9@N'$ N'f (##++ !!
''		%--  ::>>8%@@	Bs   C (C60C65C6