403Webshell
Server IP : 182.53.201.61  /  Your IP : 216.73.217.175
Web Server : Apache/2.2.15 (Fedora)
System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python2.6/site-packages/enchant/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.6/site-packages/enchant/__init__.pyo
EFc@sdZdZdZdZdZdeeeefZdefdYZddkZ	ddk
Z
ddkZddkZd	efd
YZ
defdYZd
efdYZdefdYZdefdYZdefdYZeZeiZeiZeiZeiZeiZdeifdYZdeifdYZdeifdYZdZdZe djoendS(sL
    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:

        http://www.abisource.com/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.
    
    Unicode strings are supported transparently, as they are throughout
    Python - if a unicode string is given as an argument, the result will
    be a unicode string.  Note that Enchant works in UTF-8 internally,
    so passing an ASCII string to a dictionary for a language requiring
    Unicode may result in UTF-8 strings being returned.

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

iits
%d.%d.%d%stErrorcBseZdZRS(s,Base exception class for the enchant module.(t__name__t
__module__t__doc__(((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyRUsiNtDictNotFoundErrorcBseZdZRS(s@Exception raised when a requested dictionary could not be found.(RRR(((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyR`stProviderDesccBs;eZdZdZdZdZdZdZRS(sGSimple 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

    cCs||_||_||_dS(N(tnametdesctfile(tselfRRR	((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyt__init__ns		cCsd|iS(Ns
<Enchant: %s>(R(R
((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyt__str__sscCs
t|S(N(tstr(R
((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyt__repr__vscCs6|i|ijo#|i|ijo|i|ijS(s*Equality operator on ProviderDesc objects.(RRR	(R
tpd((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyt__eq__yscCst|i|i|iS(s&Hash operator on ProviderDesc objects.(thashRRR	(R
((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyt__hash__s(RRRRRRRR(((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyRds				t_EnchantObjectcBs2eZdZdZddZdedZRS(sBase 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.
    cCs
d|_dS(s_EnchantObject constructor.N(tNonet_this(R
((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyRscCsN|djod}||iif}n|idjot|ndS(s<Check that self._this is set to a pointer, rather than None.s<%s unusable: the underlying C-library object has been freed.N(Rt	__class__RRR(R
tmsg((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyt_check_thiss

sUnspecified ErrorcCs||dS(sRaise an exception based on available error messages.
         This method causes an Error to be raised.  Subclasses should
         override it to retreive an error indication from the underlying
         API if possible.  If such a message cannot be retreived, the
         argument value <default> is used.  The class of the exception
         can be specified using the argument <eclass>
         N((R
tdefaultteclass((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyt_raise_errorsN(RRRRRRRR(((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyRs	tBrokercBseZdZdZdZdedZdZdZdZ	ddZd	Zd
Z
dZdZd
ZdZdZdZdZdZdZRS(s}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:

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

    cCsCti|ti|_|iptdnh|_dS(sBroker object constructor.
        
        This method is the constructor for the 'Broker' object.  No
        arguments are required.
        s'Could not initialise an enchant broker.N(RRt_etenchant_broker_initRRt_Broker__live_dicts(R
((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyRs


cCs(y|iWntj
onXdS(sBroker object destructor.N(t_freetAttributeError(R
((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyt__del__ssUnspecified ErrorcCsLti|i}|djp
|djo||n||dS(s=Overrides _EnchantObject._raise_error to check broker errors.RN(Rtenchant_broker_get_errorRR(R
RRterr((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyRscCs>|idj	o*ti|id|_|iindS(sfFree 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(RRRtenchant_broker_freeRtclear(R
((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyR s	cCsEy|i|cd7<Wn tj
od|i|<nX|i|S(sqIncrement the count of live Dict objects for the given tag.
        Returns the new count of live Dicts.
        i(RtKeyError(R
ttag((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyt__inc_live_dictss
cCsEy|i|cd8<Wn tj
od|i|<nX|i|S(sqDecrement the count of live Dict objects for the given tag.
        Returns the new count of live Dicts.
        ii(RR'(R
R(((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyt__dec_live_dictss
cCs
t||S(sRequest 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.
               
        (tDict(R
R(((s4/usr/lib/python2.6/site-packages/enchant/__init__.pytrequest_dictscCs|it|tjo|id}nti|i|}|djo!d}|i||ft	n|i
|d}|i||S(sRequest raw C-object data for a dictionary.
        This method call passes on the call to the C library, and does
        some internal bookkeeping.
        sutf-8s/Dictionary for language '%s' could not be foundiN(RttypetunicodetencodeRtenchant_broker_request_dictRRRRt_Broker__describe_dictt_Broker__inc_live_dicts(R
R(tnew_dictteStrtkey((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyt_request_dict_datas


cCs|it|tjo|id}nti|i|}|djod}|i||fn|i	|d}|i
|tt}|i
|||S(sRRequest 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.
        sutf-8s0Personal Word List file '%s' could not be loadediN(RR-R.R/Rtenchant_broker_request_pwl_dictRRRR1R2R+tFalset_switch_this(R
tpwlR3R4R5td((s4/usr/lib/python2.6/site-packages/enchant/__init__.pytrequest_pwl_dict#s


cCs|i|iidjo|ii}n
|i}|i|djoti|i|ind|_d|_
dS(sFree 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.
        spersonal wordlistiN(RR(tlowertproviderR	t_Broker__dec_live_dictsRtenchant_broker_free_dictRRt_broker(R
tdictR5((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyt
_free_dict9s
		cCs)|iti|i|}t|S(sCheck 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.
        (RRtenchant_broker_dict_existsRtbool(R
R(tval((s4/usr/lib/python2.6/site-packages/enchant/__init__.pytdict_existsKs
cCsJ|it|tjo|id}nti|i||dS(sSet 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.
        sutf-8N(RR-R.R/Rtenchant_broker_set_orderingR(R
R(tordering((s4/usr/lib/python2.6/site-packages/enchant/__init__.pytset_orderingVs
cCsQ|ig|_ti|i|ig}|iD]}|t|q7~S(sReturn 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.
        (Rt_Broker__describe_resultRtenchant_broker_describe_pyRt_Broker__describe_callbackR(R
t_[1]tr((s4/usr/lib/python2.6/site-packages/enchant/__init__.pytdescribegs
	cCsJ|id}|id}|id}|ii|||fdS(sCollector callback for dictionary description.
        
        This method is used as a callback into the _enchant function
        'enchant_broker_describe_py'.  It collects the given arguments in
        a tuple and appends them to the list '__describe_result'.
        sutf-8N(tdecodeRKtappend(R
RRR	((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyt__describe_callbacksscCs_|ig|_ti|i|ig}|iD]!}||dt|dfq7~S(sReturn 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.
        ii(Rt_Broker__list_dicts_resultRtenchant_broker_list_dicts_pyRt_Broker__list_dicts_callbackR(R
RNRO((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyt
list_dictss
	cCsP|id}|id}|id}|ii||||ffdS(sCollector callback for listing dictionaries.
        
        This method is used as a callback into the _enchant function
        'enchant_broker_list_dicts_py'.  It collects the given arguments into
        an appropriate tuple and appends them to '__list_dicts_result'.
        sutf-8N(RQRTRR(R
R(RRR	((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyt__list_dicts_callbackscCsEg}x8|iD]*\}}||jo|i|qqW|S(sList languages for which dictionaries are available.
        
        This function returns a list of language tags for which a
        dictionary is available.
        (RWRR(R
tlangsR(tprov((s4/usr/lib/python2.6/site-packages/enchant/__init__.pytlist_languagess

cs-gfd}ti||dS(sGet 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>)
        csJ|id}|id}|id}i||||fdS(Nsutf-8(RQRR(R(RRR	(t	cb_result(s4/usr/lib/python2.6/site-packages/enchant/__init__.pytcb_funcsi(Rtenchant_dict_describe_py(R
t	dict_dataR]((R\s4/usr/lib/python2.6/site-packages/enchant/__init__.pyt__describe_dictsN(RRRRR"RRR R2R?RR,R6R<RCRGRJRPRMRWRVR[R1(((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyRs&				
												R+cBseZdZdddZdZdZddZdedZ	dZ
dZd	Zd
Z
dZdZd
ZedZdZRS(sDictionary 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_to_session():     add a word to the current spellcheck session
        * add_to_pwl():         add a word to the personal dictionary
        * 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
    
    cCsti|d|_d|_d|_|tjo
d|_n{|djo=ti	}|djo d}|d}t
|qn|djo
t}n|i|i||dS(sODict 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.
        s0No tag specified and default language could not sbe determined.N(
RRRRAR(R>R8Rtutilstget_default_languageRR9R6(R
R(tbrokerR$((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyRs
			






cCs(y|iWntj
onXdS(sDict object desstructor.N(R R!(R
((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyR"scCsUti|||_||_|idt}|d|_t|d|_dS(smSwitch 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.
        t
check_thisiiN(	R+R RRAt_Dict__describeR8R(RR>(R
tthisRcR((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyR9s
		
cCsD|idjp|iidjo
d|_nti||dS(sExtend _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(RARRRR(R
R((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyRs#
sUnspecified ErrorcCsLti|i}|djp
|djo||n||dS(s;Overrides _EnchantObject._raise_error to check dict errors.RN(Rtenchant_dict_get_errorRR(R
RRR$((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyR%scCs(|idj	o|ii|ndS(s%Free 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(RARRC(R
((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyR ,scCs|it|tjo|id}n|}ti|i|t|}|djotS|djot	S|i
dS(sCheck spelling of a word.
        
        This method takes a word in the dictionary language and returns
        True if it is correctly spelled, and false otherwise.
        sutf-8iN(RR-R.R/Rtenchant_dict_checkRtlentTrueR8R(R
twordtinWordRF((s4/usr/lib/python2.6/site-packages/enchant/__init__.pytcheck6s


cCs|it|tjo|id}n|}ti|i|t|}t|tjo/g}|D]}||idqr~}|S|S(sSuggest possible spellings for a word.
        
        This method tries to guess the correct spelling for a given
        word, returning the possibilities in a list.
        sutf-8(	RR-R.R/Rtenchant_dict_suggest_pyRRiRQ(R
RkRltsuggsRNtwtuSuggs((s4/usr/lib/python2.6/site-packages/enchant/__init__.pytsuggestHs
*cCsV|it|tjo|id}n|}ti|i|t|dS(s,Add a word to the user's personal word list.sutf-8N(RR-R.R/Rtenchant_dict_add_to_pwlRRi(R
RkRl((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyt
add_to_pwlYs

cCsV|it|tjo|id}n|}ti|i|t|dS(sAdd a word to the session list.sutf-8N(RR-R.R/Rtenchant_dict_add_to_sessionRRi(R
RkRl((s4/usr/lib/python2.6/site-packages/enchant/__init__.pytadd_to_sessionbs

cCsR|it|tjo|id}n|}ti|i|t|S(s,Check whether a word is in the session list.sutf-8(RR-R.R/Rtenchant_dict_is_in_sessionRRi(R
RkRl((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyt
is_in_sessionks

cCs|it|tjo|id}n|}t|tjo|id}n|}ti|i|t||t|dS(stStore 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>.
        sutf-8N(RR-R.R/Rtenchant_dict_store_replacementRRi(R
tmistcortinMistinCor((s4/usr/lib/python2.6/site-packages/enchant/__init__.pytstore_replacementts
cCs2|o|inti|i|i|iS(s
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.
        (RRR^Rt_Dict__describe_callbackt_Dict__describe_result(R
Rd((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyt
__describes
cCsF|id}|id}|id}||||f|_dS(sCollector callback for dictionary description.
        
        This method is used as a callback into the _enchant function
        'enchant_dict_describe_py'.  It collects the given arguments in
        a tuple and stores them in the attribute '__describe_result'.
        sutf-8N(RQR(R
R(RRR	((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyRSsN(RRRRRR"R9RRRR RmRrRtRvRxR~RjReR(((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyR+s(			
									tDictWithPWLcBsAeZdZddZddZdZdZdZRS(s(Dictionary with managed personal word list.
    
    This class behaves as the standard Dict class, but also manages a
    personal word list stored in a seperate file.  The file must be
    specified at creation time by the 'pwl' argument to the constructor.
    Words added to the dictionary using "add_to_personal" are automatically
    appended to the pwl file.
    
    The Dict object managing the PWL is available as the 'pwl' attribute.
    
    To create a DictWithPWL from the user's default language, use None
    as the 'tag' argument.
    cCs||djotdntii|p t|d}|i~nti||||i	i
||_dS(sDictWithPWL constructor.

        The argument 'pwl' must be supplied, naming a file containing
	    the personal word list.  If this file does not exist, it is
        	created with default permissions.
        s%DictWithPWL must be given a PWL file.twtN(RRtostpathtexistsR	tcloseR+RRAR<R:(R
R(R:Rctf((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyRs

cCsB|idjo|inti|||ii|dS(s0Extend Dict._check_this() to check PWL validity.N(R:RR R+R(R
R((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyRscCs;|idj	o|iid|_nti|dS(s,Extend Dict._free() to free the PWL as well.N(R:RR R+(R
((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyR s

cCs4ti||otS|ii|otStS(sCheck 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 wordlist.
        (R+RmRjR:R8(R
Rk((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyRms
cCs|i|ii|dS(sAdd 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(RR:Rt(R
Rk((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyRts
N(	RRRRRRR RmRt(((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyRs
		
t
TestBrokercBs_eZdZdZdZdZdZdZdZdZ	dZ
d	ZRS(
sTest cases for the proper functioning of Broker objects.
    These tests assume that there is at least one working provider
    with a dictionary for the "en_US" language.
    cCst|_dS(N(RRc(R
((s4/usr/lib/python2.6/site-packages/enchant/__init__.pytsetUpscCs
|`dS(N(Rc(R
((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyttearDownscCs|i|iiddS(s*Test that the en_US language is available.ten_USN(tassert_RcRG(R
((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyttest_HasENUSscCs7x0|iiD]}|i|ii|qWdS(s<Test whether all advertised languages are in fact available.N(RcR[RRG(R
tlang((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyttest_LangsAreAvailscCsYxR|iiD]A\}}|i|ii||i||iijqWdS(s<Test whether all advertised providers are in fact available.N(RcRWRRGRP(R
RRZ((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyttest_ProvsAreAvailsc	Csh}g}xm|iiD]\\}}|i|o||i|n|g||<||jo|i|qqWxg|D]_}xV||D]J}t}|i||i|i|}|i|i	|~~qWqWx|D]}x||D]}|i}x4|D],}|||jo|id|}qqWt}|i|||i|}|i|i	|~~qWqWdS(s,Test that provider ordering works correctly.t,N(
RcRWthas_keyRRRRJRR,tassertEqualR>(	R
RYtprovsR(RZtb2R;tordertprov2((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyttest_ProvOrderingsD

			cCs|i|iiid|iid}|i|iidd|iid}|i|iidd~|i|iidd|iid}|i|iidd~~|i|iidddS(s,Test proper functioning of live dicts count.RiiiN(tfailIfRcRRR,R(R
td1td2((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyttest_LiveDicts4scCs|i|iiid|iid}|i|iiddj|iid}|i|iiddj~~|i|iiddjdS(s0Test live dicts count with normalised tag names.Rs
en_US@fakeisen_US.utf-8iiN(RRcRRR,R(R
RR((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyttest_LiveDictsNormCscCs<|iid}|i|td}|i|dS(s,Test that unicode language tags are accepteduen_USN(RcR6RR+(R
R((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyttest_UnicodeTagNs
(RRRRRRRRRRRR(((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyRs						#		tTestDictcBsqeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
RS(sTest cases for the proper functioning of Dict objects.
    These tests assume that there is at least one working provider
    with a dictionary for the "en_US" language.
    cCstd|_dS(NR(R+RB(R
((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyR\scCs
|`dS(N(RB(R
((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyR_scCs|itddS(sATest that the en_US language is available through default broker.RN(RRG(R
((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyRbscCsh|i|iid|i|iid|i|iid|i|iiddS(s-Test that check() works on some common words.thellottestthelottesttN(RRBRmR(R
((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyt
test_checkfscCs|i|iitjdS(s-Test that the dict's broker is set correctly.N(RRBRA(R
((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyttest_brokermscCs|i|iiddS(s*Test that the dict's tag is set correctly.RN(RRBR((R
((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyttest_tagqscCs#|id|iidjdS(s2Test that suggest() gets simple suggestions right.RRN(RRBRr(R
((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyttest_suggestuscCss|it|iiddj|it|iiddj|it|iiddjdS(s:Test whether suggest() hangs on some inputs (Bug #1404196)tThiisitThiiistThiiiisN(RRiRBRr(R
((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyttest_suggestHang1ys%%cCsrd}|it|tj|i|ii|x3|ii|D]}|it|tjqKWdS(s,Test checking/suggesting for unicode stringsuⅉ6N(RR-R.RRBRmRr(R
tus1ts((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyt
test_unicode1scCsx|i|iid|i|iid|iid|i|iid|i|iiddS(s8Test that adding words to the session works as required.tLozzN(RRBRmRxRvR(R
((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyttest_sessions
cCsgti}|djo|ittn7y t}|i|i|Wntj
onXdS(s,Test behavior of default language selection.N(	RaRbRtassertRaisesRR+RR(R(R
tdefLangR;((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyttest_DefaultLangs
	(RRRRRRRRRRRRRR(((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyRVs											tTestPWLcBs_eZdZdZdZdZdZdZdZdZ	dZ
d	ZRS(
sTest cases for the proper functioning of PWLs and DictWithPWL objects.
    These tests assume that there is at least one working provider
    with a dictionary for the "en_US" language.
    cCsRddk}y|id|_Wn(ttfj
o|i|_nXdS(Nii(ttempfiletmkstempt	pwlFileNmt	NameErrorR!tmktemp(R
R((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyRs
cCs"yti|iWnnXdS(N(RtremoveR(R
((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyRscCsKt|id}x(|D] }|i||idqW|idS(s!Set the contents of the PWL file.Rps
N(R	RtwriteR(R
tcontentstpwlFiletln((s4/usr/lib/python2.6/site-packages/enchant/__init__.pytsetPWLContentss
cCs,t|id}|i}|i|S(s&Retreive the contents of the PWL file.RO(R	Rt	readlinesR(R
RR((s4/usr/lib/python2.6/site-packages/enchant/__init__.pytgetPWLContentss
cCsh|iddgt|i}|i|id|i|id|i|iddS(s(Test that basic checking works for PWLs.tSazzRRN(RR<RRRmR(R
R;((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyRs
cCs&tt|i}|i|dS(s-Test that unicode PWL filenames are accepted.N(R<R.RR(R
R;((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyttest_UnicodeFNscCset|i}|i|id|id|i|id|id|ijdS(s0Test that adding words to a PWL works correctly.tFlagensFlagen
N(R<RRRmRtRR(R
R;((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyttest_adds

cCs|iddgt|i}|id|idj|id|idj|id|id|idj|id|idjd	S(
s$Test getting suggestions from a PWL.RRtsazztSaztlozzRtflagentFlagsN(RR<RRRrRtR(R
R;((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyttest_suggestionss
cCs|iddgtd|i}|i|id|i|id|i|id|i|id|i|id|id|i|id|id|ijdS(	s"Test functionality of DictWithPWL.RRRRRRsFlagen
N(RRRRRmRRtR(R
R;((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyt
test_DWPWLs
(RRRRRRRRRRRR(((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyRs								
cCsddkl}ddkl}l}ddkl}ti}|i	ti
t|i	ti
t|i	ti
t
|i	ti
||i	ti
||i	ti
||i	ti
||S(Ni(tTestChecker(tTestTokenizationtTestFilters(tTestTokenizeEN(tenchant.checkerRtenchant.tokenizeRRtenchant.tokenize.enRtunittestt	TestSuitetaddTestt	makeSuiteRRR(RRRRtsuite((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyt	testsuitescCstiitdS(N(RtTextTestRunnertrunR(((s4/usr/lib/python2.6/site-packages/enchant/__init__.pytruntestsuitest__main__(!Rt
__ver_major__t
__ver_minor__t
__ver_patch__t__ver_sub__t__version__t	ExceptionRt_enchantRRaRRRtobjectRRRR+RRAR,R<RGRWR[tTestCaseRRRRRR(((s4/usr/lib/python2.6/site-packages/enchant/__init__.pyt<module>Is>	
 %E						`JO		


Youez - 2016 - github.com/yon3zu
LinuXploit