a
     g                     @   sR   d dl mZ d dlmZ d dlmZ d dlmZ e Zda	e
ee
 dddZdS )	    )List)
thai_words)syllable_tokenize)KhaveeVerifierN)wordreturnc                 C   sP   g }t dkr dd tt D a t D ]"}t| |r$|| kr$|| q$t|S )u  
    Find Thai rhyme

    :param str word: A Thai word
    :return: All list Thai rhyme words
    :rtype: List[str]

    :Example:
    ::
        from pythainlp.util import rhyme

        print(rhyme("จีบ"))
        # output: ['กลีบ', 'กีบ', 'ครีบ', ...]
    Nc                 S   s    g | ]}t t|d kr|qS )   )lenr   ).0i r   B/usr/local/lib/python3.9/dist-packages/pythainlp/util/pronounce.py
<listcomp>!   s   zrhyme.<locals>.<listcomp>)all_thai_words_dictlistr   kvZ	is_sumpusappendsorted)r   Zlist_sumpusr   r   r   r   rhyme   s    r   )typingr   Zpythainlp.corpusr   Zpythainlp.tokenizer   Zpythainlp.khaveer   r   r   strr   r   r   r   r   <module>   s   