o
    qi                     @   s:   d Z ddlZddlmZ daefdededefddZdS )	zUrdu Lemmatizer    N)LEMMA_LOOKUP_TABLE_PATHtextlookup_pathreturnc                 C   sV   |   }tdu r$t|ddd}t|aW d   n1 sw   Y  dd |D S )z
    Get lemma of the word from lookup table

    Args:
        text (str): Urdu tokenized text
        lookup_path (str): path to the lookup json file

    Returns:
        list: A list containing tuple of word and its lemma
    Nrzutf-8)encodingc                 S   s(   g | ]}|t v r|t | fn||fqS  )_WORD2LEMMA).0wordr   r   Y/home/ubuntu/.local/lib/python3.10/site-packages/urduhack/models/lemmatizer/lemmatizer.py
<listcomp>   s   ( z lemma_lookup.<locals>.<listcomp>)splitr	   openjsonload)r   r   tokensfiler   r   r   lemma_lookup   s   r   )__doc__r   urduhack.configr   r	   strlistr   r   r   r   r   <module>   s
   