
    -i3D                        d dl mZ  G d d          Zedk    re ed           i Zdddd	d
dd	dd d	d	ddd	d	dZ ee          Z ee                                           e	                    d           e
                    d           e                    d           e                    d           e                    d           e                    d           e                    d           e                    d           e                    d           e                    d           e                    d           e                    d           e                    d            ee           dS dS )    Nc                   F   e Zd ZdZd6dZd Zd Zd Zd Zd Z	d	 Z
d
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d  Z!d! Z"d" Z#d# Z$d$ Z%d% Z&d& Z'd' Z(d( Z)d) Z*d* Z+d+ Z,d, Z-d- Z.d. Z/d/ Z0d0 Z1d1 Z2d2 Z3d3 Z4d4 Z5d5 Z6dS )7dictWordzF
    dictWord represents the data got from the lexicon dictionary
    Nc                    d| _         	 d| _        	 d| _        	 d| _        	 d| _        d| _        d| _        |r|                    dd          | _         |                    dd          | _        |                    dd          | _        |                    dd          | _        |                    dd          | _        |                                 | _	        d	| _
        d	| _        | j	        s9|                                 | _
        | j
        s|                                 | _        d	| _        d	| _        d	| _        d	| _        d	| _        d	| _        d	| _        d	| _        d	| _        d	| _        d	| _        d	| _        d	| _        d	| _        | j        r|                                 | _        | j        o|                                 | _        | j        o|                                 | _        | j        o|                                 | _        |                                  | _        | !                                | _        n:| j	        r| "                                | _        n| #                                | _        | $                                | _        | %                                | _        | j        p| &                                | _        | '                                | _        d S )
N) )r   r   word	vocalizedfreqtypeoriginalF)(r   r   tagsoriginalTagsr	   r
   r   get_isStopWordtagStopWordtagVerbtagNoun_isVerb_isNountagAdded
tagInitial	tagMasdartagProperNountagAdj	tagPouncttagTransparenttagMasculin
tagFeminin	tagPluraltagBrokenPlural
tagMamnou3	tagSingletagBreak_isAdded_isAdj	_isMasdar_isProperNoun_isBrokenPlural
_isMamnou3_isTransparent	_isPounct
_isInitial
_isFeminin	_isPlural_isBreak)self
resultDicts     N/var/www/html/speakWrite/venv/lib/python3.11/site-packages/qalsadi/dictword.py__init__zdictWord.__init__   s|   	/	H "5		 	;"vr22DI'^^K<<DN"vr22DI"vr22DI&NN:r::DM  ++-- 	.<<>>DL< .#||~~ "# $< 
	. MMOODM,84;;==DK!\>dnn.>.>DN!%!F$2D2D2F2FD#'#7#7#9#9D "oo//DOO 	."&"5"5"7"7D!^^--DN//++//++-A1A1A    c                 J    |                                  }|dk    p	|d         dv S )
        Return True if the word mark the begin of next sentence.
        @return: direct initial.
        @rtype: True/False;
        r   r   ).?;:)getWord)r/   r   s     r1   r+   zdictWord._isInitial]   s*     ||~~rz<T!W(<<<r3   c                 Z    d|                                  v pd|                                 v S )l
        Return True if the word is a noun.
        @return: is a noun.
        @rtype: True/False;
        Nounu   اسم)getTypegetTagsr/   s    r1   r   zdictWord._isNounf   s)     'E8t||~~+EEr3   c                 R    |                                  }d|v pd|v pd|v pd|v pd|v S )zv
        Return True if the word is a Adjective.
        @return: is a Adjective.
        @rtype: True/False;
        u   صفةu   اسم مفعولu   اسم فاعلu   صيغة مبالغةu
   منسوبr>   )r/   r
   s     r1   r$   zdictWord._isAdjn   sV     ||~~ $"d*$ D($ '$.$ t#	
r3   c                 .    d|                                  v S )q
        Return True if the word is a stop word.
        @return: is a noun.
        @rtype: True/False;
        STOPWORDrB   r@   s    r1   r   zdictWord._isStopWord}        T\\^^++r3   c                 .    d|                                  v S )l
        Return True if the word is a verb.
        @return: is a verb.
        @rtype: True/False;
        VerbrB   r@   s    r1   r   zdictWord._isVerb   s     ''r3   c                 .    d|                                  v S )p
        Return True if the word is a masdar.
        @return: is a masdar.
        @rtype: True/False;
        u   مصدرrB   r@   s    r1   r%   zdictWord._isMasdar   rF   r3   c                 .    d|                                  v S )zz
        Return True if the word is a proper noun.
        @return: is a proper noun.
        @rtype: True/False;
        	noun_proprB   r@   s    r1   r&   zdictWord._isProperNoun   s     dllnn,,r3   c                 Z    d|                                  v pd|                                  v S )
        Return True if the word has the state transparent, which can trasnpose the effect of the previous factor.
        @return: has the state transparent.
        @rtype: True/False;
        u   شفافu
   إشارةr?   r@   s    r1   r)   zdictWord._isTransparent   s)     T\\^^+M|t||~~/MMr3   c                 .    d|                                  v S ){
        Return True if the word is broken  plural.
        @return: is broken plural.
        @rtype: True/False;
        u   جمع تكسيرrP   r@   s    r1   r'   zdictWord._isBrokenPlural   s     #dllnn44r3   c                 .    d|                                  v S )u   
        Return True if the word is forbiden from Sarf ممنوع من الصرف.
        @return: is mamnou3 min sarf.
        @rtype: True/False;
        u   ممنوع من الصرفrP   r@   s    r1   r(   zdictWord._isMamnou3   s     ,t||~~==r3   c                 *    |                                  S zn
        Return True if the word is a plural.
        @return: is plural.
        @rtype: True/False;
        )r'   r@   s    r1   r-   zdictWord._isPlural   s     ##%%%r3   c                 V    |                                   o|                                  S zk
        Return True if the word is single.
        @return: is  dual.
        @rtype: True/False;
        isPluralisDualr@   s    r1   	_isSinglezdictWord._isSingle   s%     ==??"84;;=='88r3   c                 .    d|                                  v S )t
        Return True if the word is a pounctuation.
        @return: is a verb.
        @rtype: True/False;
        POUNCTrB   r@   s    r1   r*   zdictWord._isPounct   s     4<<>>))r3   c                 ~    |                                  p)|                                 od|                                 v S )zl
        Return True if the word has break.

        @return: is break.
        @rtype: True/False;
        break)
isStopWordisPounctr?   r@   s    r1   r.   zdictWord._isBreak   s3       ST]]__%RDLLNN9RSr3   c                 B    t           j        |                                 v S zn
        Return True if the word is Feminin.
        @return: is Feminin.
        @rtype: True/False;
        )arabyTEH_MARBUTAgetOriginalr@   s    r1   r,   zdictWord._isFeminin   s      D$4$4$6$666r3   c                     | j         S )zr
        Get the input word given by user
        @return: the given word.
        @rtype: unicode string
        r   r@   s    r1   r:   zdictWord.getWord        yr3   c                     || _         dS )z
        Set the input word given by user
        @param newword: the new given word.
        @type newword: unicode string
        Nri   )r/   newwords     r1   setWordzdictWord.setWord       			r3   c                     | j         S )z
        Get the vocalized form of the input word
        @return: the given vocalized.
        @rtype: unicode string
        )r   r@   s    r1   getVocalizedzdictWord.getVocalized  s     ~r3   c                 F    || _         t          j        |          | _        dS )z
        Set the vocalized word
        @param newvocalized: the new given vocalized.
        @type newvocalized: unicode string
        N)r   re   stripTashkeelunvocalized)r/   newvocalizeds     r1   setVocalizedzdictWord.setVocalized  s$     & .|<<r3   c                     | j         S )zu
        Get the tags form of the input word
        @return: the given tags.
        @rtype: unicode string
        r   r@   s    r1   r?   zdictWord.getTags  rj   r3   c                     || _         dS )zu
        Set the tags word
        @param newtags: the new given tags.
        @type newtags: unicode string
        Nrw   )r/   newtagss     r1   setTagszdictWord.setTags(  rn   r3   c                     | j         S )zu
        Get the freq form of the input word
        @return: the given freq.
        @rtype: unicode string
        r	   r@   s    r1   getFreqzdictWord.getFreq0  rj   r3   c                     || _         dS )zu
        Set the freq word
        @param newfreq: the new given freq.
        @type newfreq: unicode string
        Nr|   )r/   newfreqs     r1   setFreqzdictWord.setFreq:  rn   r3   c                     | j         S )z}
        Get the template form of the input word
        @return: the given template.
        @rtype: unicode string
        templater@   s    r1   getTemplatezdictWord.getTemplateB       }r3   c                     || _         dS )z
        Set the template word
        @param newtemplate: the new given template.
        @type newtemplate: unicode string
        Nr   )r/   newtemplates     r1   setTemplatezdictWord.setTemplateL       $r3   c                     | j         S )zu
        Get the type form of the input word
        @return: the given type.
        @rtype: unicode string
        r
   r@   s    r1   r>   zdictWord.getTypeT  rj   r3   c                     || _         dS )zu
        Set the type word
        @param newtype: the new given type.
        @type newtype: unicode string
        Nr   )r/   newtypes     r1   setTypezdictWord.setType^  rn   r3   c                     | j         S )zu
        Get the root form of the input word
        @return: the given root.
        @rtype: unicode string
        rootr@   s    r1   getRootzdictWord.getRootf  rj   r3   c                     || _         dS )zu
        Set the root word
        @param newroot: the new given root.
        @type newroot: unicode string
        Nr   )r/   newroots     r1   setRootzdictWord.setRootp  rn   r3   c                     | j         S )z}
        Get the original form of the input word
        @return: the given original.
        @rtype: unicode string
        r   r@   s    r1   rg   zdictWord.getOriginalx  r   r3   c                     || _         dS )z
        Set the original word
        @param neworiginal: the new given original.
        @type neworiginal: unicode string
        Nr   )r/   neworiginals     r1   setOriginalzdictWord.setOriginal  r   r3   c                     | j         S )r5   )r   r@   s    r1   	isInitialzdictWord.isInitial       r3   c                 .    d|                                  v S )zm
        Return True if the word is unknown.
        @return: is a noun.
        @rtype: True/False;
        unknownrB   r@   s    r1   	isUnknownzdictWord.isUnknown  s     DLLNN**r3   c                     | j         S )r<   )r   r@   s    r1   isNounzdictWord.isNoun       |r3   c                     | j         S )zw
        Return True if the word is an adjective.
        @return: is a adjective.
        @rtype: True/False;
        )r   r@   s    r1   isAdjzdictWord.isAdj  s     {r3   c                     | j         S )rD   )r   r@   s    r1   ra   zdictWord.isStopWord  s     r3   c                     | j         S )rH   )r   r@   s    r1   isVerbzdictWord.isVerb  r   r3   c                     | j         S )rK   )r   r@   s    r1   isMasdarzdictWord.isMasdar       ~r3   c                     | j         S )z{
        Return True if the word is a proper noun.
        @return: is a propoer noun.
        @rtype: True/False;
        )r   r@   s    r1   isProperNounzdictWord.isProperNoun  s     !!r3   c                     | j         S )r]   )r   r@   s    r1   rb   zdictWord.isPounct  r   r3   c                     | j         S )rO   )r   r@   s    r1   isTransparentzdictWord.isTransparent  s     ""r3   c                     | j          S )zp
        Return True if the word is masculin.
        @return: is masculin.
        @rtype: True/False;
        r   r@   s    r1   
isMasculinzdictWord.isMasculin  s     ?""r3   c                     | j         S rd   r   r@   s    r1   	isFemininzdictWord.isFeminin  r   r3   c                     | j         S rU   )r   r@   s    r1   rY   zdictWord.isPlural  r   r3   c                     | j         S )rR   )r   r@   s    r1   isBrokenPluralzdictWord.isBrokenPlural  s     ##r3   c                     | j         S )z
        Return True if the word is Mamnou3 min Sarf.
        @return: is Mamnou3 min Sarf.
        @rtype: True/False;
        )r    r@   s    r1   	isMamnou3zdictWord.isMamnou3	  r   r3   c                 V    |                                   o|                                  S rW   rX   r@   s    r1   isSinglezdictWord.isSingle  s%     ==??"84;;=='88r3   c                     | j         S )u   
        Return True if the word has the state added مضاف.
        @return: has the state added.
        @rtype: True/False;
        )r   r@   s    r1   isAddedzdictWord.isAdded  s     }r3   c                     | j         S N)__dict__r@   s    r1   getDictzdictWord.getDict$  s     }r3   c                     d}| j         }d|d<   |                                D ]}|d|d||         dz  }|dz  }|                    d          S )	zb
        Display objects result from analysis
        @return: text
        @rtype : text
        {Tahaaffixz
		u'z' = u'z',z
		}utf8)r   keysencode)r/   textstmwordkeys       r1   __repr__zdictWord.__repr__)  sn     -!<<>> 	A 	ACDccc73<<<@@DD	{{6"""r3   r   )7__name__
__module____qualname____doc__r2   r+   r   r$   r   r   r%   r&   r)   r'   r(   r-   r[   r*   r.   r,   r:   rm   rp   ru   r?   rz   r}   r   r   r   r>   r   r   r   rg   r   r   r   r   r   ra   r   r   r   rb   r   r   r   rY   r   r   r   r   r   r    r3   r1   r   r      s.        C( C( C( C(N= = =F F F
 
 
, , ,( ( (, , ,- - -N N N5 5 5> > >& & &9 9 9* * *T T T"7 7 7(      = = =          $ $ $          $ $ $  + + +             " " "  # # #$# # #    $ $ $  9 9 9    
# # # # #r3   r   __main__testu   الحياةu   الْحَيَاةُu   الr   u   حياةu   ُu   تعريف::مرفوع*u   Noun:مصدرu   حَيَاةٌ)r   r   	procleticprefixstemsuffixencleticr   r	   r   r   r
   r   syntaxsemantic4444)pyarabic.arabyre   r   r   printrdictstemmedWordstmwrdr   rm   ru   setProcletic	setPrefixsetStem	setSuffixsetEncleticrz   r   r   r   r   r   r   r3   r1   <module>r      s        d# d# d# d# d# d# d# d#N z	E&MMME+)$ E" [F	E&..


NN6


V
NN6
V
v
NN6
NN6
NN6
v
NN6
v 
E&MMMMMO r3   