
    -iA(                        d Z edk    rddlZej                            d           ddlmZ ddlmZ  ej	                    Z
 G d d          Zedk    r e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Z ee          Z eej                   e                    d!           e                    d!           e                    d!           e                    d!           e                    d!           e                    d!           e                    d!            ee           dS dS )"zG
wordCase represents the data resulted from the morpholocigal analysis
__main__    Nz..c                       e Zd ZdZddZd 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S )!WordCasezO
    wordCase represents the data resulted from the morpholocigal analysis
    Nc                 <   d| _         d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _	        d| _
        d| _        d| _        |r|                    dd          | _         |                    dd          | _        | j        s|                    dd          | _        |                    dd          | _        |                    d	d          | _        |                    d
d          | _        |                    dg           | _        d                    |                    dd          |                    dd          g          | _        |                    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          | _        t9          j        | j                  | _        d S d S )N -)r   r   word	vocalizedTsemivocalizedstemrootaffix:tagsoriginaltagsfreqtypeoriginallemmatensepronounactionobject_typeneednumbergenderpersonvoicemood
transitiveF)r
   word_nmr   r   unvocalizedr   	affix_keyr   original_tagsr   r   r   r   getr   r   joinr   r   r   r   r   r   r   r   r    r!   r"   arabystrip_tashkeel)selfresult_dicts     N/var/www/html/speakWrite/venv/lib/python3.11/site-packages/qalsadi/wordcase.py__init__zWordCase.__init__!   s   	" 	 	 #		
 	D#33DI(__["==DN> >!,!=!=!,"!E!ED#33DI#33DI$"55DJ,,koonb.Q.QR DI $33DI#33DI'OOJ;;DM$"55DJ$"55DJ&??9b99DL%//(B77DK*}bAAD#33DI%//(B77DK%//(B77DK%//(B77DK$"55DJ#33DI)oolEBBDO  %3DNCCD?	D 	D    r   c                 8    | j                             ||          S )z 
        get item by []
        __dict__r'   )r+   keydefaults      r-   r'   zWordCase.getd   s     }  g...r/   c                 8    | j                             |d          S )z!
        get item by key
        r   r1   )r+   r3   s     r-   __getitem__zWordCase.__getitem__j   s     }  b)))r/   c                     || j         |<   dS )z*
        setitem by key and value
        Nr2   )r+   r3   values      r-   __setitem__zWordCase.__setitem__p   s     #cr/   c                     || j         v S )z
        in function
        r8   )r+   items     r-   __contains__zWordCase.__contains__v   s     t}$$r/   c                     | j         S )zr
        Get the input word given by user
        @return: the given word.
        @rtype: unicode string
        r
   r+   s    r-   get_wordzWordCase.get_word|        yr/   c                     || _         dS )z
        Set the input word given by user
        @param newword: the new given word.
        @type newword: unicode string
        Nr?   )r+   newwords     r-   set_wordzWordCase.set_word        			r/   c                     | j         S )
        Get the vocalized form of the input word
        @return: the given vocalized.
        @rtype: unicode string
        r   r@   s    r-   get_vocalizedzWordCase.get_vocalized   s     ~r/   c                     | j         S )z
        Get the semi vocalized form of the input word with out inflection mark
        @return: the given vocalized.
        @rtype: unicode string
        )r   r@   s    r-   get_semivocalizedzWordCase.get_semivocalized   s     !!r/   c                     d| j         v S )rH   unknownr   r@   s    r-   
is_unknownzWordCase.is_unknown   s     DI%%r/   c                     || _         dS )z
        Set the vocalized word
        @param newvocalized: the new given vocalized.
        @type newvocalized: unicode string
        NrI   )r+   newvocalizeds     r-   set_vocalizedzWordCase.set_vocalized   s     &r/   c                     | j         S )zu
        Get the stem form of the input word
        @return: the given stem.
        @rtype: unicode string
        r   r@   s    r-   get_stemzWordCase.get_stem   rB   r/   c                     || _         dS )z
        set the stem form of the input word
        @param stem: given stem
        @type stem: unicode
        @return: the given stem.
        @rtype: unicode string
        NrU   )r+   r   s     r-   set_stemzWordCase.set_stem   s     			r/   c                     | j         S )zu
        Get the tags form of the input word
        @return: the given tags.
        @rtype: unicode string
        r   r@   s    r-   get_tagszWordCase.get_tags   rB   r/   c                     || _         dS )zu
        Set the tags word
        @param newtags: the new given tags.
        @type newtags: unicode string
        NrZ   )r+   newtagss     r-   set_tagszWordCase.set_tags   rF   r/   c                     | j         S )zx
        Get the affix  form of the input word
        @return: the given affix.
        @rtype: unicode string
        )r   r@   s    r-   	get_affixzWordCase.get_affix        zr/   c                     | j         S )zu
        Get the freq form of the input word
        @return: the given freq.
        @rtype: unicode string
        r   r@   s    r-   get_freqzWordCase.get_freq   rB   r/   c                     || _         dS )zu
        Set the freq word
        @param newfreq: the new given freq.
        @type newfreq: unicode string
        Nrc   )r+   newfreqs     r-   set_freqzWordCase.set_freq   rF   r/   c                     | j         S )zu
        Get the type form of the input word
        @return: the given type.
        @rtype: unicode string
        rO   r@   s    r-   get_typezWordCase.get_type   rB   r/   c                     || _         dS )zu
        Set the type word
        @param newtype: the new given type.
        @type newtype: unicode string
        NrO   )r+   newtypes     r-   set_typezWordCase.set_type   rF   r/   c                     | j         S )z}
        Get the original form of the input word
        @return: the given original.
        @rtype: unicode string
        r   r@   s    r-   get_originalzWordCase.get_original  s     }r/   c                     || _         dS )z
        Set the original word
        @param neworiginal: the new given original.
        @type neworiginal: unicode string
        Nrn   )r+   neworiginals     r-   set_originalzWordCase.set_original  s     $r/   c                     | j         S )zw
        Get the lemma form of the input word
        @return: the given lemma.
        @rtype: unicode string
        r   r@   s    r-   	get_lemmazWordCase.get_lemma  ra   r/   c                     || _         dS )zy
        Set the lemma word
        @param newlemma: the new given lemma.
        @type newlemma: unicode string
        Nrt   )r+   newlemmas     r-   	set_lemmazWordCase.set_lemma$  s     


r/   c                 @    t                               | j                  S )zb
        Display objects result from analysis
        @return: text
        @rtype : text
        )
arabicReprreprr2   r@   s    r-   __repr__zWordCase.__repr__2  s     t}---r/   c                     | j         S )z5
        Dump the word case as a simple list
        r8   r@   s    r-   dumpzWordCase.dump:  s     }r/   c                     || _         dS )zX
        load word case attributes from a simple list stored in cache data base
        Nr8   )r+   a_lists     r-   loadzWordCase.loadB  s     r/   )Nr   )__name__
__module____qualname____doc__r.   r'   r6   r:   r=   rA   rE   rJ   rL   rP   rS   rV   rX   r[   r^   r`   rd   rg   ri   rl   ro   rr   ru   rx   r|   r~   r    r/   r-   r   r      s        =D =D =D =DF/ / / /* * *# # #% % %      " " "& & && & &                    $ $ $    . . .      r/   r   testr
   u   الحياةr   u   الْحَيَاةُ	procleticu   الprefixr   r   u   حياةsuffixu   ُencleticr   u   تعريف::مرفوع*r   r   templater   u   Noun:مصدرr   u   حَيَاةٌr   syntaxsemantic4444)r   r   syspathappendpyarabic.arabyr)   pyarabic.arabreprarabrepr
ArabicReprrz   r   printRDICTstmwrdr2   rE   rS   rX   r^   rg   rl   rr   r   r/   r-   <module>r      s<    zJJJHOOD       $ $ $ $ $ $ X ""

j j j j j j j jZ	 z	E&MMM+ 	V 	"	
 	
 	$ 	B 	) 	 	 	B 	 	$ 	!  	"!" 	B#E& Xe__F	E&/
OOF
   
OOF
OOF
OOF
OOF
	E&MMMMMA r/   