
    -i#0                     V    d dl mZ  G d d          Zd Zedk    r e             dS dS )    Nc                   0   e Zd ZdZi f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- Z/d. Z0d/ Z1d0 Z2d1S )2	NounTuplezL
    A object to handle the noun tuple gotten from arramooz dictionary 
    c                 .    t          |          | _        dS )z"
        Init noun tuples
        N)dict	noun_dict)selfr   s     P/var/www/html/speakWrite/venv/lib/python3.11/site-packages/arramooz/nountuple.py__init__zNounTuple.__init__   s     i    c                     | j         S )z6
         return the all features for  a noun
        )r   r   s    r	   get_features_dictzNounTuple.get_features_dictA   s     ~r   c                 8    | j                             |d          S )z8
         return the asked feature form  a noun
         r   get)r   features     r	   get_featurezNounTuple.get_featureH   s     ~!!'"---r   c                 8    | j                             dd          S )z6
         return the vocalized form of a noun
        	vocalizedr   r   r   s    r	   get_vocalizedzNounTuple.get_vocalizedN   s     ~!!+b111r   c                 8    | j                             dd          S )z8
         return the unvocalized form of a noun
        unvocalizedr   r   r   s    r	   get_unvocalizedzNounTuple.get_unvocalizedT   s     ~!!-333r   c                 8    | j                             dd          S )z7
         return the normalized form of a noun
        
normalizedr   r   r   s    r	   get_normalizedzNounTuple.get_normalizedZ        ~!!,r222r   c                 8    | j                             dd          S )z4
         return the stamped form of a noun
        stampedr   r   r   s    r	   get_stampedzNounTuple.get_stamped`        ~!!)B///r   c                 8    | j                             dd          S )z0
         return the wordtype of a noun
        wordtyper   r   r   s    r	   get_wordtypezNounTuple.get_wordtypeg   s    
 ~!!*R000r   c                 8    | j                             dd          S )z0
         return the category of a noun
        categoryr   r   r   s    r	   get_categoryzNounTuple.get_categoryn        ~!!*R000r   c                 8    | j                             dd          S )z,
         return the root of a noun
        rootr   r   r   s    r	   get_rootzNounTuple.get_roott        ~!!&,,,r   c                 8    | j                             dd          S )z,
         return the wazn of a noun
        waznr   r   r   s    r	   get_waznzNounTuple.get_waznz   r-   r   c                 8    | j                             dd          S )zH
         return the gender of a noun (masculine, feminine, "")
        genderr   r   r   s    r	   
get_genderzNounTuple.get_gender        ~!!(2...r   c                 8    | j                             dd          S )z4
         return the feminin form if exists
        femininr   r   r   s    r	   get_femininzNounTuple.get_feminin   r"   r   c                 8    | j                             dd          S )z6
         return the  masculin form if exists
        masculinr   r   r   s    r	   get_masculinzNounTuple.get_masculin   r)   r   c                 @    | j                             dd          dk    S )z9
         return True if the gender is  feminine
        r2   r      مؤنثr   r   s    r	   is_femininezNounTuple.is_feminine   !     ~!!(2..*<<r   c                 @    | j                             dd          dk    S )z:
         return True if the gender is  masculine
        r2   r      مذكرr   r   s    r	   is_masculinezNounTuple.is_masculine   r>   r   c                 8    | j                             dd          S )zG
         return the number of a noun (signular, plural, dual)
        numberr   r   r   s    r	   
get_numberzNounTuple.get_number   r4   r   c                 H    t          |                                 dv           S )zc
         return True if the lemma word is plural (masculine, feminine, broken[irregular])
        )   جمعu   جمع تكسيرboolrD   r   s    r	   	is_pluralzNounTuple.is_plural   s"     DOO%%*IIJJJr   c                 L    t          |                                 dk              S )z<
         return True if the lemma word is singular
           مفردrG   r   s    r	   is_singularzNounTuple.is_singular   s!     DOO%%3444r   c                 8    | j                             dd          S )zC
                  return the single of the word if exists
        singler   r   r   s    r	   
get_singlezNounTuple.get_single   r4   r   c                 8    | j                             dd          S )zW
                  return True if the lemma word is plural (broken[irregular])
        broken_pluralr   r   r   s    r	   get_broken_pluralzNounTuple.get_broken_plural   s     ~!!/"555r   c                 R    t          | j                            dd                    S )z9
         return True if the word  is defined , 
        definedr   rH   r   r   r   s    r	   
is_definedzNounTuple.is_defined   $     DN&&y33444r   c                 R    t          | j                            dd                    S )z8
         return True if the word  is mankous ,
        mankousr   rU   r   s    r	   
is_mankouszNounTuple.is_mankous   rW   r   c                 R    t          | j                            dd                    S )z9
         return True if the word  is relative ,
        relativer   rU   r   s    r	   is_relativezNounTuple.is_relative   $     DN&&z!44555r   c                 R    t          | j                            dd                    S )z=
         return True if the word  is mamnou3_sarf ,
        mamnou3_sarfr   rU   r   s    r	   is_mamnou3_sarfzNounTuple.is_mamnou3_sarf   s$     DN&&~a88999r   c                 R    t          | j                            dd                    S )zA
         return True if the word  accept feminin form, 
        	feminabler   rU   r   s    r	   accept_femininzNounTuple.accept_feminin   $     DN&&{155666r   c                 R    t          | j                            dd                    S )z>
         return True if the word  accept dual form, 
        dualabler   rU   r   s    r	   accept_dualzNounTuple.accept_dual   r^   r   c                 R    t          | j                            dd                    S )zS
                  return True if the lemma word accept plural (masculine)
        masculin_pluralr   rU   r   s    r	   accept_masculine_pluralz!NounTuple.accept_masculine_plural   s%     DN&&'8;;<<<r   c                 R    t          | j                            dd                    S )zR
                  return True if the lemma word accept plural (feminine)
        feminin_pluralr   rU   r   s    r	   accept_feminine_pluralz NounTuple.accept_feminine_plural   s%     DN&&'7;;<<<r   c                 R    t          | j                            dd                    S )zB
         return True if the word  accept w_suffix form, 
        w_suffixr   rU   r   s    r	   accept_w_suffixzNounTuple.accept_w_suffix  r^   r   c                 R    t          | j                            dd                    S )zC
         return True if the word  accept hm_suffix form, 
        	hm_suffixr   rU   r   s    r	   accept_hm_suffixzNounTuple.accept_hm_suffix  re   r   c                 R    t          | j                            dd                    S )zC
         return True if the word  accept ha_suffix form, 
        	ha_suffixr   rU   r   s    r	   accept_ha_suffixzNounTuple.accept_ha_suffix  re   r   c                 R    t          | j                            dd                    S )zB
         return True if the word  accept k_suffix form, 
        k_prefixr   rU   r   s    r	   accept_k_prefixzNounTuple.accept_k_prefix  r^   r   c                 "   t          j        |          }|t           j        k    r|                                 sdS |dk    r|                                 sdS |dk    r|                                 sdS |dk    r|                                 sdS dS )zA
         return True if the word  accept given suffix, 
        Fu   هاu   همu   وT)arabystrip_tashkeelKAFaccept_k_suffixrw   rt   rq   )r   suffix	suffix_nms      r	   accept_suffixzNounTuple.accept_suffix  s     (00		!!$*>*>*@*@!5t'<'<'>'>5t'<'<'>'>5T%9%9%;%;5tr   c                 R    t          | j                            dd                    S )zD
         return True if the word  accept kal_suffix form, 
        
kal_prefixr   rU   r   s    r	   accept_kal_prefixzNounTuple.accept_kal_prefix+  s$     DN&&|A66777r   c                     t          j        |          }|dk    r|                                 sdS |dk    r|                                 sdS dS )zA
         return True if the word  accept given prefix, 
        u   كالFu   كT)r|   r}   r   rz   )r   prefix	prefix_nms      r	   accept_prefixzNounTuple.accept_prefix1  s[     (00		!!$*@*@*B*B!5T%9%9%;%;5tr   c                 ,    |                                   S )z;
         return True if the word  accept tanwin, 
        )ra   r   s    r	   accept_tanwinzNounTuple.accept_tanwin=  s     ''))))r   c                 R    t          | j                            dd                    S )zE
         return True if the word  accept plural_tanwin_nasb
        plural_tanwin_nasbr   rU   r   s    r	   accept_plural_tanwin_nasbz#NounTuple.accept_plural_tanwin_nasbC  s%     DN&&';A>>???r   c                 R    t          | j                            dd                    S )z9
         return True if the word  accept annex,
        annexr   rU   r   s    r	   accept_annexzNounTuple.accept_annexI  s$     DN&&wq11222r   c                 "   dg}|                     |                                            |                     |                                            |                                 r|                     d           n)|                                 r|                     d           |                                 r|                     d           n)|                                 r|                     d           |                                 r|                     d           |                                 r|                     d           |                                 r|                     d           t          t          |                    }|S )	z6
         return True if the word  get tags, 
        u   اسمr<   r@   rF   rK   u   ممنوع من الصرفu
   منقوصu
   منسوب)appendr%   r(   r=   rI   rL   ra   rZ   r]   listset)r   	tags_lists     r	   get_tagszNounTuple.get_tagsP  s    K	**,,---**,,--- 	)Z(((( 	)Z(((>> 	*Y'''' 	*[)))!! 	<:;;;?? 	,]+++ 	,]+++Y((	r   c                 8    | j                             dd          S )z'
         return   get lemma, 
        originalr   r   r   s    r	   	get_lemmazNounTuple.get_lemmaj  r)   r   c                 8    | j                             dd          S )z0
         return   get word definition,
        
definitionr   r   r   s    r	   get_definitionzNounTuple.get_definitionq  r   r   c                 8    | j                             dd          S )z*
         return   get word note,
        noter   r   r   s    r	   get_notezNounTuple.get_notex  r-   r   c                 4    | j                                         S )z(
        return tuple as string
        )r   __str__r   s    r	   r   zNounTuple.__str__~  s     ~%%'''r   c                 8    | j                             |d          S )"
        return attribute
        Nr   )r   keys     r	   __getitem__zNounTuple.__getitem__  s     ~!!#d+++r   c              #   H   K   | j                                         E d{V  dS )z
        :return:
        N)r   itemsr   s    r	   __iter__zNounTuple.__iter__  s4       >'')))))))))))r   c                 8    | j                             ||          S )r   r   )r   r   defaults      r	   r   zNounTuple.get  s     ~!!#g...r   N)3__name__
__module____qualname____doc__r
   r   r   r   r   r   r!   r%   r(   r,   r0   r3   r7   r:   r=   rA   rD   rI   rL   rO   rR   rV   rZ   r]   ra   rd   rh   rk   rn   rq   rt   rw   rz   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r   r	   r   r      s         $& ) ) ) )D  . . .2 2 24 4 43 3 30 0 01 1 11 1 1- - -- - -/ / /0 0 01 1 1= = == = =/ / / K K K5 5 5/ / /6 6 65 5 5$5 5 56 6 6: : :7 7 76 6 6= = == = =
6 6 67 7 77 7 76 6 6  "8 8 8	 	 	* * *@ @ @3 3 3  41 1 13 3 3- - -( ( (, , ,* * */ / / / /r   r   c                      d} i ddddddddd	dd
ddddddddddddddddddddddddddddddddddddddd}t          |          }t          |           dS )Nu
   لعلهمidi[P r   u   كَذِبٌr   u   كذبr   r    r$   u   مصدرr+   r/   r   r'   r   u   كَذَبَr2   r@   r6   r9   rC   rK   rN   rQ   rT   r      u  "كَذِبٌ-كَذِبٌ [ك ذ ب] (مص. كَذَبَ). ""أَقْوَالُهُ كَذِبٌ فِي كَذِبٍ"" : مُخَالِفَةٌ لِلْحَقِيقَةِ وَالأَمْرِ الوَاقِعِ. ""حَبْلُ الكَذِبِ قَصِيرٌ"".")rY   rc   rg   rj   rm   r`   r\   rp   rs   r   rv   ry   r   r   r   )r   print)wordntuplenns      r	   mainr     s4   DdE >X H 	
 * h b * . 
  " 
  r  !" !" ! f?  F@ 
6		B	"III1r   __main__)pyarabic.arabyr|   r   r   r   r   r   r	   <module>r      s~   0      z/ z/ z/ z/ z/ z/ z/ z/x$ $ $L zDFFFFF r   