
    g                     ^    d Z ddl ddl ddlmZ  G d de      Zd Zedk(  r e        yy)	zV
Module for reading, writing and manipulating
Toolbox databases and settings fileids.
    )*)ToolboxDatac                   4    e Zd ZddZ	 	 	 	 	 ddZd ZddZy)	ToolboxCorpusReaderNc           
          t        | j                  |d      D cg c]!  \  }}t        ||      j                  |      # c}}      S c c}}w )NT)key)concatabspathsr   parse)selffileidsr   pathencs        O/var/www/openai/venv/lib/python3.12/site-packages/nltk/corpus/reader/toolbox.pyxmlzToolboxCorpusReader.xml   sU     $(==$#?#?KT3 D#&,,,5#?
 	
s   &A	
c                     t        | j                  |d      D cg c]-  \  }}t        t        ||      j	                  |||||            / c}}      S c c}}w )NT)include_encoding)r	   r
   listr   fields)	r   r   stripunwrapencodingerrorsunicode_fieldsfileidr   s	            r   r   zToolboxCorpusReader.fields   so      &*]]7T]%R &SMVS ,33vx
 &S	
 		
s   2A
c                     d|v r	|d   }|d= nd}g } | j                   |fi |D ]8  \  }}||k(  r|j                  |g f       	 |d   d   j                  ||f       : |S # t        $ r Y Hw xY w)Nr   lx)r   append
IndexError)r   r   kwargsr   entriesmarkercontentss          r   r"   zToolboxCorpusReader.entries2   s    F?-CuC +G >v >FH}"~.BKO**FH+=> !?  " s   A""	A.-A.c                 b    | j                  |      D cg c]  \  }}||k(  s| c}}S c c}}w N)r   )r   r   r   r#   r$   s        r   wordszToolboxCorpusReader.wordsC   s1    15W1EW1E-VXSV1EWWWs   ++r&   )TTutf8strictN)r   )__name__
__module____qualname__r   r   r"   r'        r   r   r      s(    
 
*"Xr.   r   c                       y r&   r-   r-   r.   r   demor0   G   s    r.   __main__N)	__doc__nltk.corpus.reader.apinltk.corpus.reader.utilnltk.toolboxr   CorpusReaderr   r0   r*   r-   r.   r   <module>r7      s=   
 % % $0X, 0Xf	 zF r.   