a
     g                     @   sL   d Z ddlZddlmZ dZeedddZedd	d
ZedddZ	dS )zS
PyThaiNLP data tools

For text processing and text conversion, see pythainlp.util
    N)__file__zpythainlp-data)pathreturnc                 C   s   t jt | S )aj  
    This function joins path of :mod:`pythainlp` data directory and the
    given path, and returns the full path.

    :return: full path given the name of dataset
    :rtype: str

    :Example:
    ::

        from pythainlp.tools import get_full_data_path

        get_full_data_path('ttc_freq.txt')
        # output: '/root/pythainlp-data/ttc_freq.txt'
    )osr   joinget_pythainlp_data_path)r    r   >/usr/local/lib/python3.9/dist-packages/pythainlp/tools/path.pyget_full_data_path   s    r
   )r   c                  C   s4   t dt jdt} t j| }t j|dd |S )a  
    Returns the full path where PyThaiNLP keeps its (downloaded) data.
    If the directory does not yet exist, it will be created.
    The path can be specified through the environment variable
    :envvar:`PYTHAINLP_DATA_DIR`. By default, `~/pythainlp-data`
    will be used.

    :return: full path of directory for :mod:`pythainlp` downloaded data
    :rtype: str

    :Example:
    ::

        from pythainlp.tools import get_pythainlp_data_path

        get_pythainlp_data_path()
        # output: '/root/pythainlp-data'
    ZPYTHAINLP_DATA_DIR~T)exist_ok)r   getenvr   r   PYTHAINLP_DEFAULT_DATA_DIR
expandusermakedirs)Zpythainlp_data_dirr   r   r   r	   r   #   s    r   c                   C   s   t jtS )a/  
    This function returns full path of PyThaiNLP codes

    :return: full path of :mod:`pythainlp` codes
    :rtype: str

    :Example:
    ::

        from pythainlp.tools import get_pythainlp_path

        get_pythainlp_path()
        # output: '/usr/local/lib/python3.6/dist-packages/pythainlp'
    )r   r   dirnamepythainlp_filer   r   r   r	   get_pythainlp_path>   s    r   )
__doc__r   Z	pythainlpr   r   r   strr
   r   r   r   r   r   r	   <module>   s   