o
    'N i
  ã                   @   s:   d dl Z 	 dadd„ Zdd„ Zdd„ ZG d	d
„ d
eƒZdS )é    NÚ c               
   C   sL   zt dkr
tjd a W n ty }  ztdƒ‚d} ~ ww t dkr$tdƒ‚dS )a  
    Initialize the module. The following actions are performed:

    - Checks of INDIC_RESOURCES_PATH variable is set. If not, checks if it can beb initialized from 
        INDIC_RESOURCES_PATH environment variable. If that fails, an exception is raised
    r   ÚINDIC_RESOURCES_PATHzINDIC_RESOURCES_PATH not setN)r   ÚosÚenvironÚ	ExceptionÚIndicNlpException)Úe© r	   úC/home/ubuntu/.local/lib/python3.10/site-packages/indicnlp/common.pyÚinit   s   
€€ÿÿr   c                   C   s   t S )z?
        Get the path to the Indic NLP Resources directory
    ©r   r	   r	   r	   r
   Úget_resources_path#   s   r   c                 C   s   | a dS )z?
        Set the path to the Indic NLP Resources directory
    Nr   )Úresources_pathr	   r	   r
   Úset_resources_path)   s   r   c                   @   s    e Zd ZdZdd„ Zdd„ ZdS )r   z’
        Exceptions thrown by Indic NLP Library components are instances of this class.  
        'msg' attribute contains exception details.
    c                 C   s
   || _ d S ©N)Úmsg)Úselfr   r	   r	   r
   Ú__init__5   ó   
zIndicNlpException.__init__c                 C   s
   t | jƒS r   )Úreprr   )r   r	   r	   r
   Ú__str__8   r   zIndicNlpException.__str__N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r	   r	   r	   r
   r   0   s    r   )r   r   r   r   r   r   r   r	   r	   r	   r
   Ú<module>   s   