
    -i                        d Z ddlmZ ddlmZ i Z G d d          Zedk    r ed           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e
           dS dS )zK
stemmed_word represents the data resulted from the morpholocigal analysis
    N   )stemmedaffixc                      e Zd ZdZdpdZd Zd ZdqdZd Zd	 Z	dqd
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/d0 Z0d1 Z1d2 Z2d3 Z3d4 Z4d5 Z5d6 Z6d7 Z7d8 Z8d9 Z9d: Z:d; Z;d< Z<d= Z=d> Z>d? Z?d@ Z@dA ZAdB ZBdC ZCdD ZDdE ZEdF ZFdG ZGdH ZHdI ZIdJ ZJdK ZKdL ZLdM ZMdN ZNdO ZOdP ZPdQ ZQdR ZRdS ZSdT ZTdU ZUdV ZVdW ZWdX ZXdY ZYdZ ZZd[ Z[d\ Z\d] Z]d^ Z^d_ Z_d` Z`da Zadb ZbdpdcZcdd Zdde Zedf Z dg Zfdh Zgdi Zhdj Zidk Zjdl Zkdm Zldn ZmdpdoZndS )rStemmedWordzS
    stemmed_word represents the data resulted from the morpholocigal analysis
    Nc                 
   d| _         d| _        d| _        d| _        d| _        d| _        d}d| _        d| _        d| _        d| _	        d| _
        d| _        d| _        |r|                    dd          | _         |                    dd          | _        |                    dd          | _        |                    d	d          | _        |                    d
d          | _        d                    |                    dg                     | _        |                    dd          }d                    |                    dd          |                    dd          g          | _        |                    dd          | _        |                    dd          | _	        |                    dd          | _
        |                    dd          | _        |                    dd          | _        |                    dd          | _        |                    dd          | _        |                     |                    dd                    | _        | j        | _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        |                      |                    dd                     | _!        |                    dd           | _"        |                    dd           | _#        | $                                | _%        | &                                | _'        | (                                rX| )                                | _        | *                                | _        d                    | j        | j         g          | _        | +                                r|                    dd          | _,        |                    dd          | _        |                    dd          | _        |                    dd          | _        |                    dd          | _        |                    d d          | _        d                    | j        |g          | _        | -                                r&d                    | j        | j         g          | _        | j        t\          vr!t_          j0        |          t\          | j        <   | -                                r| 1                                | _        | 2                                | _        | 3                                | _        d S )!N r	   -)r   Tword	vocalizedsemivocalizedstemrootaffixtags:originaltagsfreqtypeoriginallemmaactionobject_typeneedFpersonnumbergender|tensevoicemood	confirmedpronoun
transitive)4r   r   unvocalizedr   r   	affix_keyr   original_tagsr   r   r   r   tag_regulargetr   joinr   r   r   r   _StemmedWord__get_typetag_type	tag_addedtag_initialtag_transparenttag_mamnou3	tag_break	tag_voicetag_moodtag_confirmedtag_pronountag_transitive_StemmedWord__get_person
tag_persontag_original_numbertag_original_gender_StemmedWord__get_number
tag_number_StemmedWord__get_gender
tag_genderis_noun	_is_added_is_mamnou3is_verb	tag_tenseis_stopwordGLOBAL_AFFIXESr   StemmedAffix_is_transparent_is_initial	_is_break)self
resultdict
affix_tagss      Q/var/www/html/speakWrite/venv/lib/python3.11/site-packages/qalsadi/stemmedword.py__init__zStemmedWord.__init__   s   	  	
 	 #		
 	  	H"vr22DI'^^K<<DN!+!D!DD"vr22DI"vr22DI*..""="=>>DJ#33J++Z^^NB-O-OP DI #vr22DI"vr22DI&NN:r::DM#44DJ %..266DK  *~~mR@@D"vr22DI OOJNN62,F,FGGDM  $ " #++JNN8T,J,JKK $.>>(D#A#A #->>(D#A#A ++--++--<<>> 	C!^^--DN#//11D XXt~ty&ABBDN<<>> 	D'^^GR88DN'^^GR88DN&NN6266DM!+R!@!@D)~~i<<D",..u"E"ED !XXt~z&BCCDN 	C !XXt~ty&ABBDN>//-9-Fz-R-RN4>* 	:#'#7#7#9#9D ++-- ))    c                 J    |                                  }|dk    p	|d         dv S )8Return True if the word mark the begin of next sentence.r	   r   ).?r	   r   )get_word)rJ   r   s     rM   rH   zStemmedWord._is_initial   s(    }}rz;T!W(;;;rO   c                    d| _         |                                 sC|                                 s/d|                                 v s	d| j        v r| xj         dz  c_         |                                 s&d|                                 v r| xj         dz  c_         |                                 sd|                                 v s	d| j        v ru| xj         dz  c_         d|                                 v r| xj         d	z  c_         d
|                                 v r| xj         dz  c_         d| j        v r| xj         dz  c_         | j         dk    r| xj         dz  c_         | j         S )um  
        Return the int code of the number state.
        the number cases are coded in binary like
        not defined        : 0  00000
        single  : 1  00001
        dual    : 2  00010
        plural  : 4  00100
        masculin plural: 8  01000
        feminin plural : 16 10000
        irregular plural : 32 100000
        this codification allow to have two marks for the same case,
        like irregular plural and single can have the same mark
        هذا الترميز يسمح بترميز المفرد وجمع التكسير معا
        @return: get the number state .
        @rtype: int
        r   u   مفردr   u   مثنى      جمع   u   جمع مذكر سالم      جمع مؤنث سالم      جمع تكسير    )r<   _affix_is_plural_affix_is_dualget_tagsr9   rJ   s    rM   __get_numberzStemmedWord.__get_number   sg   & $$&& 	%t/B/B/D/D 	%T]]__,,t?W1W1W1$$$&& 	%T]]__,,1$!!##	&4==??**D444OOq OO)T]]__<<1$)T]]__<<2%"d&>>>2%?aOOq OOrO   r	   c                 B   d| _         d|                                 v s|rd|v r| xj         dz  c_         d|                                 v s|rd|v r| xj         dz  c_         d|                                 v s|rd|v r| xj         dz  c_         | j         sd| _         | j         S )a  
        Return the int code of the person state.
        the person cases are coded in binary like
        not defined        : 0  00000
        first  : 1  00001
        second    : 2  00010
        third  : 4  00100
        @return: get the person state .
        @rtype: int
        r   u
   متكلمr   u
   مخاطبrV   u   غائبrX   )r8   r`   )rJ   given_person_tags     rM   __get_personzStemmedWord.__get_person   s     4==??** +!-1A!A!AOOq OO4==??** +!-1A!A!AOOq OO(( )!+/?!?!?OOq OO 	 DO
 rO   c                 >    d| _         d| j        v rd| _         | j         S )z
        Return the int code of the regular state.
        the regular cases are coded in binary like
        regular   : 1
        irregular  : 0
        @return: get the regular state .
        @rtype: int
        Tr\   F)r(   r9   ra   s    rM   __get_regularzStemmedWord.__get_regular   s+      $":::$DrO   c                    d| _         |sdS d|v r| xj         dz  c_         d|v r| xj         dz  c_         d|v sd|v sd|v r| xj         d	z  c_         d|v r| xj         d
z  c_         d|v s2d|v s.d|v s*d|v s&d|v s"d|v sd|                                 v sd|v sd|v r| xj         dz  c_         d|v r| xj         dz  c_         d|v r| xj         dz  c_         d|v r| xj         dz  c_         | j         S )u)  
        Return the numeric code of word type.
        the number cases are coded in binary like
        not defined        : 0  00000
        stopword  : 1  00001
        verb    : 2  00010
        noun  : 4  00100
        this codification allow to have two types for the same case,
        like a stop word can be a noun, the correspendant code is 101
        هذا الترميز يسمح بترميز الحروف والأسماء،
        بعض الأدوات هي أسماء
        @return: numeric code of type .
        @rtype: int
        r   STOPWORDr   VerbrV   Nounu   اسم   مصدرrX   rY   u   صفة   اسم مفعول   اسم فاعلu   صيغة مبالغةu   فاعلu   اسم تفضيلu
   منسوبadjr[   	noun_propr]   POUNCT@   NUMBER   )r,   r`   )rJ   
input_types     rM   
__get_typezStemmedWord.__get_type   sn      	1##MMQMMZMMQMMZ8z#9#9Z:=U=UMMQMM##MMQMM 
"""j00 J..&*44Z''"j00t}}..z))
""MMRMM*$$MMRMMz!!MMRMMz!!MMS MM}rO   c                    d| _         |                                 sd| j        v rd| _         nd|                                 v s,d|                                 v sd|                                 v rd| _         nFd|                                 v r0t          j        |                                 vrd| j        vrd| _         t          j        |                                 v r| xj         d	z  c_         nd
| j        v sd
|                                 v r| xj         d	z  c_         nd|                                 v r| xj         d	z  c_         n|                                 r| xj         d	z  c_         nd|                                 v r:t          j        |                                 v s	d| j        v r| xj         d	z  c_         nEd| j        v r<d|                                 v sd|                                 v r| xj         d	z  c_         | j         S )aL  
        Return the int code of the gender state.
        the number cases are coded in binary like
        not defined        : 0  00000
        masculin  : 1  00001
        feminin    : 2  00010
        this codification allow to have case in the same word
        @return: get the numeric sex state .
        @rtype: int
        r   u   مذكرr   rn   rm   u   صفة مشبهةrl   rW   rV   u   مؤنثrZ   u   جامد)	r>   _affix_is_femininr:   get_typearabyTEH_MARBUTAget_originalr9   r`   )rJ   input_genders     rM   __get_genderzStemmedWord.__get_gender%  s    %%'' 	$T555"#!T]]__44&$--//99&$--//99"# dmmoo--%T->->-@-@@@D$<<<"#  1 1 3 333OOq OOO4333zT]]__7T7TOOq OOO'4==??::OOq OOO##%% 	!OOq OOO4==??**!2!2!4!4444333OOq OOO 111$--//))Z4==??-J-JOOq OO rO   c                 .    d|                                  v S )z
        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   شفاف)r`   ra   s    rM   rG   zStemmedWord._is_transparentc  s     T]]__,,rO   c                 Z    d|                                  v pd|                                 v S )u   
        Return True if the word is forbiden from Sarf ممنوع من الصرف.
        @return: is mamnou3 min sarf.
        @rtype: True/False
        u   ممنوع من الصرفrp   )r`   ry   ra   s    rM   rA   zStemmedWord._is_mamnou3t  s.     ,t}}>`+QUQ^Q^Q`Q`B``rO   c                 j    | j         t          v r$t          | j                                                  S dS )zGet the procleticr	   )r&   rE   get_procleticra   s    rM   r   zStemmedWord.get_procletic|  s/    
 >^++!$.1??AAArrO   c                 j    | j         t          v r$t          | j                                                  S dS )zreturn if the word has jonctionr	   )r&   rE   is_3tfra   s    rM   has_jonctionzStemmedWord.has_jonction  s/     >^++!$.188:::rrO   c                 j    | j         t          v r$t          | j                                                  S dS )zreturn True if has procleticF)r&   rE   has_procleticra   s    rM   r   zStemmedWord.has_procletic  s/    
 >^++!$.1??AAAurO   c                     | j         S )z%return True if the verb is transitiver6   ra   s    rM   is_transitivezStemmedWord.is_transitive       ""rO   c                     | j         S )uC   return True if the verb is indirect transitive  متعدي بحرفr   ra   s    rM   is_indirect_transitivez"StemmedWord.is_indirect_transitive  r   rO   c                 j    | j         t          v r$t          | j                                                  S dS )zGet the prefixr	   )r&   rE   
get_prefixra   s    rM   r   zStemmedWord.get_prefix  s/    
 >^++!$.1<<>>>rrO   c                 j    | j         t          v r$t          | j                                                  S dS )zGet the suffixr	   )r&   rE   
get_suffixra   s    rM   r   zStemmedWord.get_suffix  s/     >^++!$.1<<>>>rrO   c                 j    | j         t          v r$t          | j                                                  S dS )zGet the encleticr	   )r&   rE   get_encleticra   s    rM   r   zStemmedWord.get_encletic  s/     >^++!$.1>>@@@rrO   c                 j    | j         t          v r$t          | j                                                  S dS )zreturn True if has encleticF)r&   rE   has_encleticra   s    rM   r   zStemmedWord.has_encletic  s/     >^++!$.1>>@@@urO   c                 j    | j         t          v r$t          | j                                                  S dS )5   Return True if the word has the state added مضاف.F)r&   rE   is_addedra   s    rM   _affix_is_addedzStemmedWord._affix_is_added  s-    >^++!$.1::<<<urO   c                 *    |                                  S r   )r   ra   s    rM   r@   zStemmedWord._is_added  s     ##%%%rO   c                 j    | j         t          v r$t          | j                                                  S dS )#Return True if the word is Feminin.F)r&   rE   
is_femininra   s    rM   rx   zStemmedWord._affix_is_feminin  -    >^++!$.1<<>>>urO   c                 j    | j         t          v r$t          | j                                                  S dS )$Return True if the word is a plural.F)r&   rE   	is_pluralra   s    rM   r^   zStemmedWord._affix_is_plural  -    >^++!$.1;;===urO   c                 j    | j         t          v r$t          | j                                                  S dS )z"Return True if the word is a dual.Fr&   rE   is_dualra   s    rM   r_   zStemmedWord._affix_is_dual  -    >^++!$.199;;;urO   c                    d}|                                  rd|                                 v rd}n|                                 r+|                                 s|                                 sd}ns| j        t          v r't          | j                                                 rd}n>|                                 r*| 	                                s| 
                                rd}|S )"Return True if the word has break.FbreakT)	is_pounctr`   rD   r?   is_transparentr&   rE   is_breakr   has_jarhas_istfham)rJ   results     rM   rI   zStemmedWord._is_break  s     >> 	4==?? : :FF 		 		t?R?R?T?T 		FFNn,,t~.7799 - FF!! 	||~~ !1!1!3!3 rO   c                     | j         S )z Get the input word given by userr   ra   s    rM   rT   zStemmedWord.get_word  s     yrO   c                     || _         dS )z Set the input word given by userNr   )rJ   newwords     rM   set_wordzStemmedWord.set_word   s    			rO   c                     | j         S )z(Get the vocalized form of the input word)r   ra   s    rM   get_vocalizedzStemmedWord.get_vocalized  s     ~rO   c                 F    || _         t          j        |          | _        dS )zSet the vocalized wordN)r   rz   strip_tashkeelr%   )rJ   newvocalizeds     rM   set_vocalizedzStemmedWord.set_vocalized
  s"    % /==rO   c                     | j         S )z?
        Get the semi vocalized form of the input word
        )r   ra   s    rM   get_semivocalizedzStemmedWord.get_semivocalized  s     !!rO   c                     | j         S )z5
        Get the stem form of the input word
        )r   ra   s    rM   get_stemzStemmedWord.get_stem       yrO   c                     | j         S )5
        Get the tags form of the input word
        r   ra   s    rM   r`   zStemmedWord.get_tags  r   rO   c                 @    | j         d| j        | j        | j        fz  z   S )r   z	T%dG%dN%d)r   r,   r>   r<   ra   s    rM   get_tags_to_displayzStemmedWord.get_tags_to_display'  s.     y;MOO*
 
 
 	
rO   c                     || _         dS )z#
        Set the tags word
        Nr   )rJ   newtagss     rM   set_tagszStemmedWord.set_tags3       			rO   c                 j    | j         t          v r$t          | j                                                  S dS )z;
        Get the affix tags form of the input word
        r	   )r&   rE   r`   ra   s    rM   get_affix_tagszStemmedWord.get_affix_tags9  s/     >^++!$.1::<<<rrO   c                     | j         S )z7
        Get the affix  form of the input word
        )r   ra   s    rM   	get_affixzStemmedWord.get_affixC       zrO   c                     | j         S )z7
        Get the action form of the input word
        )r   ra   s    rM   
get_actionzStemmedWord.get_actionK  s     {rO   c                     | j         S )z<
        Get the object_type form of the input word
        )r   ra   s    rM   get_object_typezStemmedWord.get_object_typeS       rO   c                     | j         S )z5
        Get the need form of the input word
        )r   ra   s    rM   get_needzStemmedWord.get_need[  r   rO   c                     | j         S )z5
        Get the freq form of the input word
        r   ra   s    rM   get_freqzStemmedWord.get_freqc  r   rO   c                     || _         dS )z#
        Set the freq word
        Nr   )rJ   newfreqs     rM   set_freqzStemmedWord.set_freqk  r   rO   c                     | j         S )z5
        Get the type form of the input word
        r   ra   s    rM   ry   zStemmedWord.get_typeq  r   rO   c                     || _         dS )z#
        Set the type word
        Nr   )rJ   newtypes     rM   set_typezStemmedWord.set_typey  r   rO   c                     | j         S z9
        Get the original form of the input word
        r   ra   s    rM   r|   zStemmedWord.get_original  s     }rO   c                     | j         S r   )r   ra   s    rM   	get_lemmazStemmedWord.get_lemma  r   rO   c                     | j         S )z5
        Get the root form of the input word
        )r   ra   s    rM   get_rootzStemmedWord.get_root  r   rO   c                     | j         S z1
        Get the tense of the input verb
        )rC   ra   s    rM   	get_tensezStemmedWord.get_tense       ~rO   c                     | j         S r   r5   ra   s    rM   get_pronounzStemmedWord.get_pronoun  r   rO   c                     | j         S r   r   ra   s    rM   get_attached_pronounz StemmedWord.get_attached_pronoun  r   rO   c                     || _         dS )zSet the original wordNr   )rJ   neworiginals     rM   set_originalzStemmedWord.set_original  s    #rO   c                     | j         S )rQ   )r.   ra   s    rM   
is_initialzStemmedWord.is_initial      rO   c                 .    d|                                  v S )z#Return True if the word is unknown.unknown)ry   ra   s    rM   
is_unknownzStemmedWord.is_unknown  s    DMMOO++rO   c                 0    t          | j        dz            S )'Return True if the word is a stop word.rV   boolr,   ra   s    rM   rD   zStemmedWord.is_stopword  s    DMA%&&&rO   c                 V    |                                  o|                                 dv S )r   )u   فِيu   عَنْu
   إِلَىu
   عَلَى)rD   r|   ra   s    rM   is_indirect_transitive_stopwordz+StemmedWord.is_indirect_transitive_stopword  s+    !!od&7&7&9&9=o&oorO   c                 6    t          | j        dz  dz            S )z"Return True if the word is a verb.rV   r   ra   s    rM   rB   zStemmedWord.is_verb      DMQ&*+++rO   c                 6    t          | j        dz  dz            S )z"Return True if the word is a noun.rX   rV   r   ra   s    rM   r?   zStemmedWord.is_noun  r  rO   c                 6    t          | j        dz  dz            S )z$Return True if the word is a masdar.rY   rV   r   ra   s    rM   	is_masdarzStemmedWord.is_masdar  r  rO   c                 6    t          | j        dz  dz            S )z(Return True if the word is an adjective.r[   rV   r   ra   s    rM   is_adjzStemmedWord.is_adj      DMR'!+,,,rO   c                 6    t          | j        dz  dz            S )z)Return True if the word is a proper noun.r]   rV   r   ra   s    rM   is_proper_nounzStemmedWord.is_proper_noun  r  rO   c                 6    t          | j        dz  dz            S )z*Return True if the word is a pounctuation.rr   rV   r   ra   s    rM   r   zStemmedWord.is_pounct  r  rO   c                 6    t          | j        dz  dz            S )z$Return True if the word is a number.rt   rV   r   ra   s    rM   	is_numberzStemmedWord.is_number  s    DMS(1,---rO   c                     | j         S )zzReturn True if the word has the state transparent,
        which can trasnpose the effect of the previous factor.
        )r/   ra   s    rM   r   zStemmedWord.is_transparent  s     ##rO   c                     |                                  s|                                 rdS | j        t          v r$t          | j                                                 S dS ).Return True if the word has the state majrour.TF)is_mabnir   r&   rE   
is_majrourra   s    rM   r  zStemmedWord.is_majrour  sS    
 ==?? 	dllnn 	4>^++!$.1<<>>>urO   c                    |                                  r|                                 rdS dS d|                                 v r|                                 rdS | j        t
          v r$t
          | j                                                 S dS )z.Return True if the word has the state mansoub.FTu
   منصوب)r  r   r`   is_feminin_pluralr&   rE   
is_mansoubra   s    rM   r  zStemmedWord.is_mansoub  s     ==?? 	||~~ ut4==??**t/E/E/G/G*4>^++!$.1<<>>>urO   c                     |                                  r|                                 rdS dS | j        t          v r$t          | j                                                 S dS )z.Return True if the word has the state marfou3.FT)r  r   r&   rE   
is_marfou3ra   s    rM   r  zStemmedWord.is_marfou3  sY     ==?? 	||~~ ut>^++!$.1<<>>>urO   c                 j    | j         t          v r$t          | j                                                  S dS )r  F)r&   rE   
is_majzoumra   s    rM   r  zStemmedWord.is_majzoum  r   rO   c                     d|                                  v rdS | j        t          v r$t          | j                                                 S dS )z,Return True if the word has the state mabni.u   مبنيTF)r`   r&   rE   r  ra   s    rM   r  zStemmedWord.is_mabni"  sE    ((4>^++!$.1::<<<urO   c                 *   | j         t          v r$t          | j                                                  S d|                                 v rdS d|                                 v rdS d|                                 v rdS d|                                 v rdS dS )z.Return True if the word has the state definde.u   ضميرTu   اسم إشارةu   اسم موصولrp   F)r&   rE   
is_definedr`   ra   s    rM   r  zStemmedWord.is_defined*  s     >^++!$.1<<>>>4==??**4 DMMOO334 DMMOO334DMMOO++4urO   c                 j    | j         t          v r$t          | j                                                  S dS )z+Return True if the word has the tense past.F)r&   rE   is_pastra   s    rM   r  zStemmedWord.is_past:  r   rO   c                 j    | j         t          v r$t          | j                                                  S dS )z.Return True if the word has the tense passive.F)r&   rE   
is_passivera   s    rM   r  zStemmedWord.is_passive@  r   rO   c                 j    | j         t          v r$t          | j                                                  S dS )z.Return True if the word has the tense present.F)r&   rE   
is_presentra   s    rM   r!  zStemmedWord.is_presentF  r   rO   c                 0    t          | j        dz            S z+Return True if the word has the 1st person.rV   r   r8   ra   s    rM   is_speaker_personzStemmedWord.is_speaker_personL      DOa'(((rO   c                 6    t          | j        dz  dz            S z+Return True if the word has the 2nd person.rV   r$  ra   s    rM   is_present_personzStemmedWord.is_present_personP      DOq(1,---rO   c                 6    t          | j        dz  dz            S +Return True if the word has the 3rd person.rX   rV   r$  ra   s    rM   is_absent_personzStemmedWord.is_absent_personT  s     DOq(1,---rO   c                 X    t          | j        dz            o|                                 S r#  r   r8   	is_singlera   s    rM   is1stpersonzStemmedWord.is1stpersonY  s&    DOa'((=T^^-=-==rO   c                 ^    t          | j        dz  dz            o|                                 S r(  r0  ra   s    rM   is2ndpersonzStemmedWord.is2ndperson]  s+    DOq(1,--B$..2B2BBrO   c                 ^    t          | j        dz  dz            o|                                 S r,  r0  ra   s    rM   is3rdpersonzStemmedWord.is3rdpersona  s-     DOq(1,--B$..2B2BBrO   c                     t          | j        dz  dz            o'|                                 o|                                 S r,  )r   r8   r1  r   ra   s    rM   is3rdperson_femininzStemmedWord.is3rdperson_femininf  s:    DOq(1,--X$..2B2BXtGXGXXrO   c                     t          | j        dz  dz            o'|                                 o|                                 S r,  )r   r8   r1  is_masculinra   s    rM   is3rdperson_masculinz StemmedWord.is3rdperson_masculinj  s@     A%)**Vt~~/?/?VDDTDTDVDV	
rO   c                 6    t          | j        dz  dz            S )r-  rV   r$  ra   s    rM   has_imperative_pronounz"StemmedWord.has_imperative_pronount  r*  rO   c                 j    | j         t          v r$t          | j                                                  S dS z#Return True if the word has tanwin.F)r&   rE   	is_tanwinra   s    rM   r@  zStemmedWord.is_tanwin{  r   rO   c                 j    | j         t          v r$t          | j                                                  S dS r?  )r&   rE   r   ra   s    rM   r   zStemmedWord.has_jar  r   rO   c                 j    | j         t          v r$t          | j                                                  S dS r?  )r&   rE   r   ra   s    rM   r   zStemmedWord.has_istfham  s-    >^++!$.1==???urO   c                     | j         S )r   )r1   ra   s    rM   r   zStemmedWord.is_break  r   rO   c                 j    | j         t          v r$t          | j                                                  S dS )z,Return True if the word is  Masculin plural.F)r&   rE   is_masculin_pluralra   s    rM   rE  zStemmedWord.is_masculin_plural  s-    >^++!$.1DDFFFurO   c                 j    | j         t          v r$t          | j                                                  S dS )z!Return True if the word is  dual.Fr   ra   s    rM   r   zStemmedWord.is_dual  r   rO   c                 j    | j         t          v r$t          | j                                                  S dS )z+Return True if the word is  Feminin plural.F)r&   rE   r  ra   s    rM   r  zStemmedWord.is_feminin_plural  s-    >^++!$.1CCEEEurO   c                 0    t          | j        dz            S )z$Return True if the word is masculin.rV   r   r>   ra   s    rM   r:  zStemmedWord.is_masculin  r&  rO   c                 6    t          | j        dz  dz            S )r   rV   rI  ra   s    rM   r   zStemmedWord.is_feminin  r*  rO   c                 6    t          | j        dz  dz            S )r   rX   rV   r   r<   ra   s    rM   r   zStemmedWord.is_plural  r*  rO   c                 6    t          | j        dz  dz            S )z*Return True if the word is broken  plural.r]   rV   rL  ra   s    rM   is_broken_pluralzStemmedWord.is_broken_plural  s    DOr)A-...rO   c                     | j         S )z,Return True if the word is Mamnou3 min Sarf.)r0   ra   s    rM   
is_mamnou3zStemmedWord.is_mamnou3  r   rO   c                 V    |                                   o|                                  S )z"Return True if the word is single.)r   r   ra   s    rM   r1  zStemmedWord.is_single  s%    >>###:DLLNN(::rO   c                     | j         S r   )r-   ra   s    rM   r   zStemmedWord.is_added  s
    ~rO   c                     | j         S )zgetdictionary function__dict__ra   s    rM   get_dictzStemmedWord.get_dict  s     }rO   c                     | j         |         S )z9Allow access like obj[3] or obj['key'] if data is a dict.rT  rJ   keys     rM   __getitem__zStemmedWord.__getitem__  s    }S!!rO   c                 8    | j                             ||          S NrU  r)   )rJ   rY  defaults      rM   r)   zStemmedWord.get  s    }  g...rO   c                 *    t          | j                  S )z#Allow iteration over internal data.)iterrU  ra   s    rM   __iter__zStemmedWord.__iter__  s    DM"""rO   c                 *    t          | j                  S r\  )lenrU  ra   s    rM   __len__zStemmedWord.__len__  s    4=!!!rO   c                     dS )NStemmerWord ra   s    rM   __name__zStemmedWord.__name__  s    }rO   c                 *    |                                  S )$Display objects result from analysis)__str__ra   s    rM   __repr__zStemmedWord.__repr__  s    ||~~rO   c                 ~    d}| j         }d|d<   |                                D ]}|d|d||         dz  }|dz  }|S )rj  {Tahar   z
		u'z' = u'z', z
		}rU  keys)rJ   textstmwordrY  s       rM   rk  zStemmedWord.__str__  s_    -!<<>> 	B 	BCDsssGCLLLAADD	rO   c                     || j         |<   d S r\  rT  )rJ   rY  values      rM   __setitem__zStemmedWord.__setitem__  s    "crO   c                     | j         |= d S r\  rT  rX  s     rM   __delitem__zStemmedWord.__delitem__  s    M#rO   c                     || j         v S r\  rT  rX  s     rM   __contains__zStemmedWord.__contains__  s    dm##rO   c                 4    | j                                         S r\  rp  ra   s    rM   rq  zStemmedWord.keys  s    }!!###rO   c                 4    | j                                         S r\  )rU  valuesra   s    rM   r}  zStemmedWord.values  s    }##%%%rO   c                 4    | j                                         S r\  )rU  itemsra   s    rM   r  zStemmedWord.items  s    }""$$$rO   c                 2     | j         S  fd|D             S )Nc                 H    i | ]}|j                             |d           S r   r]  ).0frJ   s     rM   
<dictcomp>z'StemmedWord.to_dict.<locals>.<dictcomp>  s-    <<<4=$$Q++<<<rO   rT  )rJ   fieldss   ` rM   to_dictzStemmedWord.to_dict  s*    >= <<<<V<<<<rO   r\  r   )orh  
__module____qualname____doc__rN   rH   r;   r7   _StemmedWord__get_regularr+   r=   rG   rA   r   r   r   r   r   r   r   r   r   r   r@   rx   r^   r_   rI   rT   r   r   r   r   r   r`   r   r   r   r   r   r   r   r   r   ry   r   r|   r   r   r   r   r   r   r   r   rD   r   rB   r?   r  r  r	  r   r  r   r  r  r  r  r  r  r  r  r!  r%  r)  r.  r2  r4  r6  r8  r;  r=  r@  r   r   r   rE  r   r  r:  r   r   rN  rP  r1  r   rV  rZ  r)   ra  rd  rl  rk  rv  rx  rz  rq  r}  r  r  rg  rO   rM   r   r      s        n* n* n* n*d< < <
* * *X   B     $2 2 2h< < < <|- - -"a a a      # # ## # #          & & &
        0      > > >
" " "    

 

 

                                         $ $ $     , , ,' ' 'p p p, , ,, , ,, , ,- - -- - -- - -. . .$ $ $"
 
 
                 ) ) ). . .. . .
> > >C C CC C C
Y Y Y
 
 
. . .              ) ) ). . .. . ./ / /     ; ; ;    " " "/ / / /# # #" " "      # # #  $ $ $$ $ $& & &% % %= = = = = =rO   r   __main__testu   الحياةu   الْحَيَاةُu   الr	   u   حياةu   ُu   تعريف::مرفوع*u   Noun:مصدرu   حَيَاةٌ)r   r   	procleticprefixr   suffixencleticr   r   r   templater   r   syntaxsemantic4444)r  pyarabic.arabyrz   r	   r   rE   r   rh  printRDICTstmwrdrV  r   r   r   r   r   r   rg  rO   rM   <module>r     st               n= n= n= n= n= n= n= n=v z	E&MMM +)$! E$ [F	E&//


OOF
   
OOF
OOF
OOF
	E&MMMMM? rO   