a
     g                     @   s.   d Z ddlZddlmZmZ G dd dZdS )zS
Command line for PyThaiNLP's soundex.

It takes input text from the command line.
    N)DEFAULT_SOUNDEX_ENGINEsoundexc                   @   s   e Zd Zdd ZdS )Appc              	   C   sr   t jdddt dd}|jdddtg d	d
td |jdtdd ||dd  }t|j|jd}t	| d S )Nr   z(Convert a text to its sound-based index.zhthainlp soundex [-a algorithm] <text>

algorithms:

udom83
lk82
metasound

Default soundex algorithm is ut   .

<text> should be inside double quotes.

Example:

thainlp soundex -a lk82 "มอเตอร์ไซค์"

--)progdescriptionusagez-az--algo	algorithm)Zudom83Zlk82Z	metasoundzsoundex algorithm)desttypechoiceshelpdefaulttextz
input text)r
   r      )Zengine)
argparseArgumentParserr   add_argumentstr
parse_argsr   r   r   print)selfargvparserargsZsdx r   ?/usr/local/lib/python3.9/dist-packages/pythainlp/cli/soundex.py__init__   s0    	zApp.__init__N)__name__
__module____qualname__r   r   r   r   r   r      s   r   )__doc__r   Zpythainlp.soundexr   r   r   r   r   r   r   <module>   s   