
    Vh	                         d Z ddl ddl ddlmZ ddlmZ ej                  d      Z	ej                  d      Z
ej                  d      Zej                  d      Z G d	 d
e      Zy)a  
Sinica Treebank Corpus Sample

http://rocling.iis.sinica.edu.tw/CKIP/engversion/treebank.htm

10,000 parsed sentences, drawn from the Academia Sinica Balanced
Corpus of Modern Chinese.  Parse tree notation is based on
Information-based Case Grammar.  Tagset documentation is available
at https://www.sinica.edu.tw/SinicaCorpus/modern_e_wordtype.html

Language and Knowledge Processing Group, Institute of Information
Science, Academia Sinica

The data is distributed with the Natural Language Toolkit under the terms of
the Creative Commons Attribution-NonCommercial-ShareAlike License
[https://creativecommons.org/licenses/by-nc-sa/2.5/].

References:

Feng-Yi Chen, Pi-Fang Tsai, Keh-Jiann Chen, and Chu-Ren Huang (1999)
The Construction of Sinica Treebank. Computational Linguistics and
Chinese Language Processing, 4, pp 87-104.

Huang Chu-Ren, Keh-Jiann Chen, Feng-Yi Chen, Keh-Jiann Chen, Zhao-Ming
Gao, and Kuang-Yu Chen. 2000. Sinica Treebank: Design Criteria,
Annotation Guidelines, and On-line Interface. Proceedings of 2nd
Chinese Language Processing Workshop, Association for Computational
Linguistics.

Chen Keh-Jiann and Yu-Ming Hsieh (2004) Chinese Treebanks and Grammar
Extraction, Proceedings of IJCNLP-04, pp560-565.
    )*)map_tagsinica_parsez^#\S+\sz(?<=\))#.*$z:([^:()|]+):([^:()|]+)z:[^:()|]+:([^:()|]+)c                   *    e Zd ZdZd Zd ZddZd Zy)SinicaTreebankCorpusReaderz)
    Reader for the sinica treebank.
    c                     |j                         }t        j                  d|      }t        j                  d|      }|gS )N )readline
IDENTIFIERsubAPPENDIX)selfstreamsents      R/home/dcms/DCMS/lib/python3.12/site-packages/nltk/corpus/reader/sinica_treebank.py_read_blockz&SinicaTreebankCorpusReader._read_block9   s5     ~~b$'||B%v    c                     t        |      S Nr   r   r   s     r   _parsez!SinicaTreebankCorpusReader._parse?   s    D!!r   Nc           
          t         j                  |      D cg c]	  \  }}||f }}}|r:|| j                  k7  r+|D cg c]  \  }}|t        | j                  ||      f  }}}|S c c}}w c c}}w r   )TAGWORDfindall_tagsetr   )r   r   tagsettwtagged_sents         r   _tagzSinicaTreebankCorpusReader._tagB   sw    ,3OOD,AB&1a1vBBf,DO:@1aGDLL&!45K   Cs   A( #A.c                 ,    t         j                  |      S r   )WORDr   r   s     r   _wordz SinicaTreebankCorpusReader._wordJ   s    ||D!!r   r   )__name__
__module____qualname____doc__r   r   r!   r$    r   r   r   r   4   s    ""r   r   N)r(   nltk.corpus.reader.apinltk.corpus.reader.utilnltk.tagr   	nltk.treer   recompiler   r   r   r#   SyntaxCorpusReaderr   r)   r   r   <module>r1      s`   B % %  "ZZ
#
::n%
**.
/	zz)*"!3 "r   