o
    i                     @   s   d Z ddlZddlZddlmZ ddlmZmZ dddZdddZ	dd	d
Z
dd ZdddZedkrFed e
d e	d ed dS dS )z-
Provide structured access to documentation.
    N)wrap)findopen_datafilec                 C      t d|  d S )Nbrown_tagset_format_tagset
tagpattern r   =/home/ubuntu/.local/lib/python3.10/site-packages/nltk/help.pyr         r   c                 C   r   )Nclaws5_tagsetr   r	   r   r   r   r      r   r   c                 C   r   )Nupenn_tagsetr   r	   r   r   r   r      r   r   c                 C   sN   | D ]"}|| }|d |d  g}t |d dddd}td||  qd S )Nz: r      K   z    )widthinitial_indentsubsequent_indent
)r   printjoin)tagstagdicttagentrydefnexamplesr   r   r   _print_entries$   s   r   c                    s   t td|  d}t|}W d    n1 sw   Y   s*tt|| d S  |v r6t g| d S t   fddt|D }|rOt|| d S td d S )Nzhelp/tagsets_json/PY3_json/z.jsonc                    s   g | ]	}  |r|qS r   )match).0r   r	   r   r   
<listcomp>9   s    z"_format_tagset.<locals>.<listcomp>zNo matching tags found.)	r   r   jsonloadr   sortedrecompiler   )tagsetr
   finr   r   r   r	   r   r   .   s   
r   __main__zNN.*z.*\$	UNDEFINEDNN)N)__doc__r"   r%   textwrapr   	nltk.datar   r   r   r   r   r   r   __name__r   r   r   r   <module>   s    


	

