Interset/Tagset/ZH/Conll.pm untested

filter: Statementstmt 0.0% 0 / 511 Branchbran 0.0% 0 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 13 Podpod 0.0% 0 / 7 totaltotal 0.0% 0 / 543 CC 7 SCAR 27.1
CC
7
Cov
0%
encode
42.0
decode
6.0
get_tagset_id
2.0
CRAP 15.1
1 # ABSTRACT: Driver for the Chinese tagset of the CoNLL 2006 & 2007 Shared Tasks (derived from the Academia Sinica Treebank).
2 # Documentation in Chu-Ren Huang, Keh-Jiann Chen, Shin Lin (1997): Corpus on Web: Introducing the First Tagged and Balanced Chinese Corpus.
3 # See also here: http://ckip.iis.sinica.edu.tw/CKIP/engversion/20corpus.htm
4 # Copyright © 2007, 2015, 2017 Dan Zeman <zeman@ufal.mff.cuni.cz>
5  
6 package Lingua::Interset::Tagset::ZH::Conll;
7 use strict;
8 use warnings;
9 our $VERSION = '3.014';
10  
11 use utf8;
12 use open ':utf8';
13 use namespace::autoclean;
14 use Moose;
15 extends 'Lingua::Interset::Tagset::Conll';
16  
17  
18  
19 #------------------------------------------------------------------------------
20 # Returns the tagset id that should be set as the value of the 'tagset' feature
21 # during decoding. Every derived class must (re)define this method! The result
22 # should correspond to the last two parts in package name, lowercased.
23 # Specifically, it should be the ISO 639-2 language code, followed by '::' and
24 # a language-specific tagset id. Example: 'cs::multext'.
25 #------------------------------------------------------------------------------
26 sub get_tagset_id
27 {
28 return 'zh::conll';
29 }
30  
31  
32  
33 #------------------------------------------------------------------------------
34 # Creates atomic drivers for surface features.
35 #------------------------------------------------------------------------------
36 sub _create_atoms
37 {
38 my $self = shift;
39 my %atoms;
40 # PART OF SPEECH ####################
41 $atoms{pos} = $self->create_atom
42 (
43 'surfeature' => 'pos',
44 'decode_map' =>
45 {
46 # noun or pronoun
47 # N Naa: 水 = water, 地 = ground, 茶 = tea, 土地 = land, 食物 = food
48 # N Nab: 人 = people, 者 = person, 媽媽 = mother, 地方 = place, 爸爸 = father
49 # N Nac: 國家 = country, 政府 = government, 問題 = issue, 事 = thing, 社會 = society
50 # N Nad: 時候 = time, 時間 = time, 文化 = culture, 生活 = life, 歷史 = history
51 # N Naea: 們 = they, 人人 = everyone, 國人 = people, 百貨 = merchandise, 飲食 = diet/food
52 # N Naeb: 錢 = money, 人民 = people, 人們 = people, 海鮮 = seafood, 父母 = parents
53 'Naa' => ['pos' => 'noun', 'nountype' => 'com'],
54 'Nab' => ['pos' => 'noun', 'nountype' => 'com', 'other' => {'subpos' => 'ab'}],
55 'Nac' => ['pos' => 'noun', 'nountype' => 'com', 'other' => {'subpos' => 'ac'}],
56 'Nad' => ['pos' => 'noun', 'nountype' => 'com', 'other' => {'subpos' => 'ad'}],
57 'Naea' => ['pos' => 'noun', 'nountype' => 'com', 'other' => {'subpos' => 'aea'}],
58 'Naeb' => ['pos' => 'noun', 'nountype' => 'com', 'other' => {'subpos' => 'aeb'}],
59 # N Nba: 中共 = Chinese Communist Party, 國民黨 = Kuomintang, 民進黨 = DPP, 老包 = Old Package, 布希 = Bush
60 # N Nbc: 李 Lǐ, 林 Lín, 郝 Hǎo, 張 Zhāng, 于 Yú (probably Chinese surnames?)
61 'Nba' => ['pos' => 'noun', 'nountype' => 'prop'],
62 'Nbc' => ['pos' => 'noun', 'nountype' => 'prop', 'other' => {'subpos' => 'bc'}],
63 # location noun (including some proper nouns, e.g. Feizhou = Africa)
64 # N Nca: 台灣 = Taiwan, 中國 = China, 美國 = USA, 日本 = Japan, 蘇聯 = Soviet Union
65 # N Ncb: 公司 = company, 世界 = world, 家 = home, 國 = country, 公園 = park
66 # N Ncc: 國內 = domestic, 國際 = international, 民間 = folk, 國外 = foreign, 眼前 = present
67 # Ncd = localizer
68 # N Ncda: 上 shàng = on, 裡 lǐ = in, 中 zhōng = in, 內 nèi = within, 邊 biān = edge, border
69 # N Ncdb: 這裡 zhèlǐ = here, 那裡 nàlǐ = there, 西方 xīfāng = west, 哪裡 nǎlǐ = where, 內部 nèibù = interior
70 # N Nce: 當地 = local, 兩岸 = both sides, 全球 = global, 外國 = foreign, 本土 = local
71 'Nca' => ['pos' => 'noun', 'advtype' => 'loc'],
72 'Ncb' => ['pos' => 'noun', 'advtype' => 'loc', 'other' => {'subpos' => 'cb'}],
73 'Ncc' => ['pos' => 'noun', 'advtype' => 'loc', 'other' => {'subpos' => 'cc'}],
74 'Ncda' => ['pos' => 'noun', 'advtype' => 'loc', 'other' => {'subpos' => 'cda'}],
75 'Ncdb' => ['pos' => 'noun', 'advtype' => 'loc', 'other' => {'subpos' => 'cdb'}],
76 'Nce' => ['pos' => 'noun', 'advtype' => 'loc', 'other' => {'subpos' => 'ce'}],
77 # time noun
78 # N Ndaaa: 年代 = era, 17世紀 = 17th century, 19世紀, 18世紀, 15世紀
79 # N Ndaab: 民國 = Republic, 明 = Ming, 清 = Qing, 明朝 = Ming Dynasty, 清朝 = Qing Dynasty
80 # N Ndaac: 光緒 = Guangxu, 明治 = Meiji, 江戶 = Edo, 寬永 = Kanei, 萬曆 = Wanli
81 # N Ndaad: 西元 xīyuán = AD, 一九九0年 = 1990, 七十九年 = 1990, 1992年 = 1992, 七十六年 = 76 years (of the Republic?) / 1987
82 # N Ndaba: 今年 = this year, 去年 = last year, 明年 = next year, 隔年 = next year, 元年 = first year
83 # N Ndabb: 春天 = spring, 夏天 = summer, 秋天 = fall, 冬天 = winter, 春 = spring
84 # N Ndabc: 月 = month, 十月 = October, 十一月 = November, 九月 = September, 八月 = August
85 # N Ndabd: 昨天 = yesterday, 今天 = today, 昨日 = yesterday, 今日 = today, 明天 = tomorrow
86 # N Ndabe: 當時 = at the time, 同時 = at the same time, 下午 = in the afternoon, 晚上 = at night, 上午 = morning
87 # N Ndabf: 季 = season, 當年 = that year, 際 = occasion, 假日 = holiday, 新年 = New Year
88 # N Ndbb: 末期 = late, 後 = later (only these two words, each occurred once)
89 # N Ndc: 盤中 = middle of the day, 戰後 = after the war, 晚間 = evening, 日後 = future, 午後 = afternoon
90 # N Ndda: 過去 = past, 以前 = before, 古代 = ancient times, 當時 = at the time, 從前 = before
91 # N Nddb: 後來 = later, 未來 = future, 不久 = soon, 將來 = future, 以後 = after
92 # N Nddc: 目前 = for now, 現在 = right now, 最後 = finally, 如今 = now, 最近 = recently
93 'Ndaaa' => ['pos' => 'noun', 'advtype' => 'tim'],
94 'Ndaab' => ['pos' => 'noun', 'advtype' => 'tim', 'other' => {'subpos' => 'daab'}],
95 'Ndaac' => ['pos' => 'noun', 'advtype' => 'tim', 'other' => {'subpos' => 'daac'}],
96 'Ndaad' => ['pos' => 'noun', 'advtype' => 'tim', 'other' => {'subpos' => 'daad'}],
97 'Ndaba' => ['pos' => 'noun', 'advtype' => 'tim', 'other' => {'subpos' => 'daba'}],
98 'Ndabb' => ['pos' => 'noun', 'advtype' => 'tim', 'other' => {'subpos' => 'dabb'}],
99 'Ndabc' => ['pos' => 'noun', 'advtype' => 'tim', 'other' => {'subpos' => 'dabc'}],
100 'Ndabd' => ['pos' => 'noun', 'advtype' => 'tim', 'other' => {'subpos' => 'dabd'}],
101 'Ndabe' => ['pos' => 'noun', 'advtype' => 'tim', 'other' => {'subpos' => 'dabe'}],
102 'Ndabf' => ['pos' => 'noun', 'advtype' => 'tim', 'other' => {'subpos' => 'dabf'}],
103 'Ndbb' => ['pos' => 'noun', 'advtype' => 'tim', 'other' => {'subpos' => 'dbb'}],
104 'Ndc' => ['pos' => 'noun', 'advtype' => 'tim', 'other' => {'subpos' => 'dc'}],
105 'Ndda' => ['pos' => 'noun', 'advtype' => 'tim', 'other' => {'subpos' => 'dda'}],
106 'Nddb' => ['pos' => 'noun', 'advtype' => 'tim', 'other' => {'subpos' => 'ddb'}],
107 'Nddc' => ['pos' => 'noun', 'advtype' => 'tim', 'other' => {'subpos' => 'ddc'}],
108 # classifier (measure word)
109 ###!!! There are much less occurrences than I would expect for this sort of words!
110 # N Nfa: 個 gè (months), 次 cì (times), 句 jù (sentences), 隻 zhī (only), 頁 yè (pages)
111 # N Nfc: 攤 = stalls, 項 = items, 席 = seats
112 # N Nfd: 點 = points, 層 = layers, 段 = sections, 些 = some
113 # N Nfe: 杯 = cups, 桶 = buckets
114 # N Nfg: 年 = years, 歲 = years, 元 = yuans, 美元 = dollars, 天 = days
115 # N Nfh: 成, 股 = shares
116 # N Nfi: 次 = times, 場 = fields
117 'Nfa' => ['pos' => 'noun', 'nountype' => 'class'],
118 'Nfc' => ['pos' => 'noun', 'nountype' => 'class', 'other' => {'subpos' => 'fc'}],
119 'Nfd' => ['pos' => 'noun', 'nountype' => 'class', 'other' => {'subpos' => 'fd'}],
120 'Nfe' => ['pos' => 'noun', 'nountype' => 'class', 'other' => {'subpos' => 'fe'}],
121 'Nfg' => ['pos' => 'noun', 'nountype' => 'class', 'other' => {'subpos' => 'fg'}],
122 'Nfh' => ['pos' => 'noun', 'nountype' => 'class', 'other' => {'subpos' => 'fh'}],
123 'Nfi' => ['pos' => 'noun', 'nountype' => 'class', 'other' => {'subpos' => 'fi'}],
124 # pronoun
125 # N Nhaa: 我 wǒ = I, 他 tā = he, 我們 wǒmen = we, 你 nǐ = you, 他們 tāmen = they
126 # N Nhab: 自己 zìjǐ = oneself, 大家 dàjiā = everyone, 雙方 shuāngfāng = both sides, 個人 gèrén = person, 自我 zìwǒ = self
127 # N Nhac: 您 nín = you, 敝國 bìguó = mine, 筆者 bǐzhě = author/I, 貴國 guìguó = your, 本人 běnrén = myself/himself
128 # N Nhb: 誰 shuí = who, 您 nín = you, 筆者 bǐzhě = author/I, 孰 shú = what, 各人 gèrén = everyone
129 # N Nhc: 之 zhī = it, 前者 = the former, 後者 = the latter, 凡此種種 = all these, 兩者 = both
130 'Nhaa' => ['pos' => 'noun', 'prontype' => 'prs'],
131 'Nhab' => ['pos' => 'noun', 'prontype' => 'prs', 'reflex' => 'yes'],
132 'Nhac' => ['pos' => 'noun', 'prontype' => 'prs', 'polite' => 'form'],
133 'Nhb' => ['pos' => 'noun', 'prontype' => 'int'],
134 'Nhc' => ['pos' => 'noun', 'prontype' => 'prn', 'gender' => 'neut'],
135 # verbal noun
136 # N Nv1: 發展 = development, 服務 = service, 醫療 = medical treatment, 攻擊 = attack, 經營 = run
137 # N Nv2: 注意 = attention, 同意 = consent, 認同 = identification, 欣賞 = appreciation, 了解 = understanding
138 # N Nv3: 有關 = relation, 重視 = importance, 優惠 = preference, 認識 = understanding, 領先 = lead
139 # N Nv4: 旅遊 = travel, 購物 = shopping, 觀光 = sightseeing, 旅行 = travel, 反彈 = rally
140 'Nv1' => ['pos' => 'noun', 'verbform' => 'ger'],
141 'Nv2' => ['pos' => 'noun', 'verbform' => 'ger', 'other' => {'subpos' => 'v2'}],
142 'Nv3' => ['pos' => 'noun', 'verbform' => 'ger', 'other' => {'subpos' => 'v3'}],
143 'Nv4' => ['pos' => 'noun', 'verbform' => 'ger', 'other' => {'subpos' => 'v4'}],
144 # A A non-predicative adjective
145 # Examples: 主要 = main, 一般 = general, 共同 = common, 最佳 = optimal, 唯一 = the only
146 'A' => ['pos' => 'adj'],
147 # determiner
148 # anaphoric determiner (this, that)
149 # Ne Nep: 這 zhè = this, 此 cǐ = this, 其 qí = its, 什麼 shénme = any, 那 nà = that
150 'Nep' => ['pos' => 'adj', 'prontype' => 'dem'],
151 # classifying determiner (much, half)
152 # Ne Neqa: 全 quán = all, 許多 xǔduō = a lot of, 這些 zhèxiē = these, 一些 yīxiē = some, 其他 qítā = other
153 # Neqb = postposed classifier determiner
154 # Ne Neqb: 多 duō = many, 以上 = more/above, 左右 zuǒyòu = about/approximately, 許 xǔ = perhaps, 上下 shàngxià = up and down
155 'Neqa' => ['pos' => 'adj', 'prontype' => 'prn'],
156 'Neqb' => ['pos' => 'adj', 'prontype' => 'prn', 'other' => {'subpos' => 'qb'}],
157 # specific determiner (you, shang, ge = every)
158 # Ne Nes: 各 gè = each, 有 yǒu = there is, 該 gāi = that, 本 běn = this, 另 lìng = other
159 'Nes' => ['pos' => 'adj', 'prontype' => 'prn', 'other' => {'subpos' => 's'}],
160 # numeric determiner (one, two, three)
161 # Ne Neu: 一 yī = one, 二 èr = two, 兩 liǎng = two, 三 sān = three, 四 sì = four
162 'Neu' => ['pos' => 'num', 'numtype' => 'card'],
163 # verb
164 # V V_11: 是 shì = be, 乃是, 像是, 可說是, 有
165 # V V_12: 是 shì = be
166 # V V_2: 有 yǒu = have/there is, 有沒有, 是, 包括有
167 'V_11' => ['pos' => 'verb', 'other' => {'subpos' => '_11'}],
168 'V_12' => ['pos' => 'verb', 'other' => {'subpos' => '_12'}],
169 'V_2' => ['pos' => 'verb', 'other' => {'subpos' => '_2'}],
170 # VA = active intransitive verb
171 # V VA11: 來, 走, 飛, 回來, 出來
172 # V VA12: 站, 坐, 生活, 存在, 消失
173 # V VA13: 回家, 出國, 爬山, 回國, 上場
174 # V VA2: 動, 聚集, 上演, 轉, 集合
175 # V VA3: 下雨, 日出, 退潮, 出太陽, 地震
176 # V VA4: 笑, 出發, 讀書, 工作, 旅行
177 'VA11' => ['pos' => 'verb', 'subcat' => 'intr', 'other' => {'subpos' => 'A11'}],
178 'VA12' => ['pos' => 'verb', 'subcat' => 'intr', 'other' => {'subpos' => 'A12'}],
179 'VA13' => ['pos' => 'verb', 'subcat' => 'intr', 'other' => {'subpos' => 'A13'}],
180 'VA2' => ['pos' => 'verb', 'subcat' => 'intr', 'other' => {'subpos' => 'A2'}],
181 'VA3' => ['pos' => 'verb', 'subcat' => 'intr', 'other' => {'subpos' => 'A3'}],
182 'VA4' => ['pos' => 'verb', 'subcat' => 'intr', 'other' => {'subpos' => 'A4'}],
183 # VB = active pseudo-transitive verb
184 # V VB11: 打電話, 相較, 拍照, 再見, 開玩笑
185 # V VB12: 提前, 完工, 相比, 加油, 說出來
186 # V VB2: 拿出來, 撕票, 送醫, 挖出來, 吞下去
187 'VB11' => ['pos' => 'verb'], # default because occurs also with +SPV, +NEG, +ASP, +DE
188 'VB12' => ['pos' => 'verb', 'other' => {'subpos' => 'B12'}],
189 'VB2' => ['pos' => 'verb', 'other' => {'subpos' => 'B2'}],
190 # VC = active transitive verb
191 # V VC1: 在, 到, 去, 過, 進入
192 # V VC2: 看, 參加, 進行, 玩, 打
193 # V VC31: 做, 吃, 喝, 作, 接受
194 # V VC32: 帶, 進, 攜帶, 載, 投
195 # V VC33: 寫, 成立, 建, 放, 設
196 'VC1' => ['pos' => 'verb', 'subcat' => 'tran', 'other' => {'subpos' => 'C1'}],
197 'VC2' => ['pos' => 'verb', 'subcat' => 'tran', 'other' => {'subpos' => 'C2'}],
198 'VC31' => ['pos' => 'verb', 'subcat' => 'tran', 'other' => {'subpos' => 'C31'}],
199 'VC32' => ['pos' => 'verb', 'subcat' => 'tran', 'other' => {'subpos' => 'C32'}],
200 'VC33' => ['pos' => 'verb', 'subcat' => 'tran', 'other' => {'subpos' => 'C33'}],
201 # VD = ditransitive verb
202 # V VD1: 提供, 給, 賣, 送, 送給
203 # V VD2: 搶, 租, 借, 索, 贏
204 'VD1' => ['pos' => 'verb', 'subcat' => 'tran', 'other' => {'subpos' => 'D1'}],
205 'VD2' => ['pos' => 'verb', 'subcat' => 'tran', 'other' => {'subpos' => 'D2'}],
206 # VE = active transitive verb with sentential object
207 # V VE11: 問, 詢問, 請問, 質詢, 質問
208 # V VE12: 告訴, 回答, 安排, 答應, 反映
209 # V VE2: 說, 表示, 想, 指出, 認為
210 'VE11' => ['pos' => 'verb', 'subcat' => 'tran', 'other' => {'subpos' => 'E11'}],
211 'VE12' => ['pos' => 'verb', 'subcat' => 'tran', 'other' => {'subpos' => 'E12'}],
212 'VE2' => ['pos' => 'verb', 'subcat' => 'tran', 'other' => {'subpos' => 'E2'}],
213 # VF = active transitive verb with VP object
214 # V VF1: 繼續, 準備, 拒絕, 申請, 停止
215 # V VF2: 請, 要求, 供, 叫, 派
216 'VF1' => ['pos' => 'verb', 'subcat' => 'tran', 'other' => {'subpos' => 'F1'}],
217 'VF2' => ['pos' => 'verb', 'subcat' => 'tran', 'other' => {'subpos' => 'F2'}],
218 # VG = classificatory verb
219 # V VG1: 為, 作為, 叫, 稱, 視為
220 # V VG2: 為, 成為, 像, 成, 做
221 'VG1' => ['pos' => 'verb', 'other' => {'subpos' => 'G1'}],
222 'VG2' => ['pos' => 'verb', 'other' => {'subpos' => 'G2'}],
223 # VH = stative intransitive verb
224 # VHC = stative causative verb
225 # V VH11: 好, 新, 這樣, 一樣, 不同
226 # V VH12: 長, 深, 成長, 重, 漲
227 # V VH13: 大, 小, 高, 多, 快
228 # V VH14: 出現, 流行, 生長, 生存, 林立
229 # V VH15: 值得, 容易, 可惜, 適合, 夠
230 # V VH16: 增加, 結束, 統一, 產生, 豐富
231 # V VH17: 死, 敗, 掉, 餓, 遺失
232 # V VH21: 快樂, 興奮, 失望, 愉快, 緊張
233 # V VH22: 滿足, 感動, 可憐, 驚, 委屈
234 'VH11' => ['pos' => 'verb', 'subcat' => 'intr', 'other' => {'subpos' => 'H11'}],
235 'VH12' => ['pos' => 'verb', 'subcat' => 'intr', 'other' => {'subpos' => 'H12'}],
236 'VH13' => ['pos' => 'verb', 'subcat' => 'intr', 'other' => {'subpos' => 'H13'}],
237 'VH14' => ['pos' => 'verb', 'subcat' => 'intr', 'other' => {'subpos' => 'H14'}],
238 'VH15' => ['pos' => 'verb', 'subcat' => 'intr', 'other' => {'subpos' => 'H15'}],
239 'VH16' => ['pos' => 'verb', 'subcat' => 'intr', 'other' => {'subpos' => 'H16'}],
240 'VH17' => ['pos' => 'verb', 'subcat' => 'intr', 'other' => {'subpos' => 'H17'}],
241 'VH21' => ['pos' => 'verb', 'subcat' => 'intr', 'other' => {'subpos' => 'H21'}],
242 'VH22' => ['pos' => 'verb', 'subcat' => 'intr', 'other' => {'subpos' => 'H22'}],
243 # VI = stative pseudo-transitive verb
244 # V VI1: 陌生, 感興趣, 過敏, 沈醉, 恭敬
245 # V VI2: 為主, 聞名, 沒辦法, 著稱, 留念
246 # V VI3: 受雇, 取材, 來自, 薰陶, 取自
247 'VI1' => ['pos' => 'verb', 'other' => {'subpos' => 'I1'}],
248 'VI2' => ['pos' => 'verb', 'other' => {'subpos' => 'I2'}],
249 'VI3' => ['pos' => 'verb', 'other' => {'subpos' => 'I3'}],
250 # VJ = stative transitive verb
251 # V VJ1: 發生, 超過, 維持, 歡迎, 靠
252 # V VJ2: 欣賞, 享受, 尊重, 謝謝, 熟悉
253 # V VJ3: 沒有, 無, 具, 獲得, 擁有
254 'VJ1' => ['pos' => 'verb', 'subcat' => 'tran', 'other' => {'subpos' => 'J1'}],
255 'VJ2' => ['pos' => 'verb', 'subcat' => 'tran', 'other' => {'subpos' => 'J2'}],
256 'VJ3' => ['pos' => 'verb', 'subcat' => 'tran', 'other' => {'subpos' => 'J3'}],
257 # VK = stative transitive verb with sentential object
258 # V VK1: 知道, 希望, 覺得, 喜歡, 怕
259 # V VK2: 包括, 造成, 需要, 顯示, 所謂
260 'VK1' => ['pos' => 'verb', 'subcat' => 'tran', 'other' => {'subpos' => 'K1'}],
261 'VK2' => ['pos' => 'verb', 'subcat' => 'tran', 'other' => {'subpos' => 'K2'}],
262 # VL = stative transitive verb with VP object
263 # V VL1: 愛, 敢, 肯, 喜愛, 不禁
264 # V VL2: 開始, 負責, 持續, 用來, 不宜
265 # V VL3: 輪到, 輪, 該, 輪由
266 # V VL4: 讓, 使, 令, 使得, 導致
267 'VL1' => ['pos' => 'verb', 'subcat' => 'tran', 'other' => {'subpos' => 'L1'}],
268 'VL2' => ['pos' => 'verb', 'subcat' => 'tran', 'other' => {'subpos' => 'L2'}],
269 'VL3' => ['pos' => 'verb', 'subcat' => 'tran', 'other' => {'subpos' => 'L3'}],
270 'VL4' => ['pos' => 'verb', 'subcat' => 'tran', 'other' => {'subpos' => 'L4'}],
271 # adverb
272 # Da = possibly preceding a noun
273 # D Daa: 只 = only, 約 = approximately, 才 = only, 共 = altogether, 僅 = only
274 # D Dab: 都 = all, 所, 均 = all, 皆 = all, 完全 = entirely
275 # D Dbaa: 是 = is, 會 = can/will, 可能 = maybe, 不會 = will not, 一定 = for sure
276 # D Dbab: 要 = want, 能 = can, 可以 = can, 可 = can, 來 = come
277 # D Dbb: 也 = also, 還 = also, 則 = then, 卻 = yet, 並 = and
278 # D Dbc: 看起來 = looks, 看來 = seems, 說起來 = speaks, 聽起來 = sounds, 吃起來 = tastes
279 # D Dc: 不 = not, 未 = not, 沒有 = there is no, 沒 = not, 非 = non-
280 # D Dd: 就 = then, 又 = again, 已 = already, 將 = will, 才 = only
281 # Dfa = preceding VH through VL
282 # D Dfa: 很 = very, 最 = most, 更 = more, 較 = relatively, 非常 = very much
283 # Dfb = following a V
284 # D Dfb: 一點 = a little, 極了 = extremely, 些 = some, 得很 = very, 多 = more
285 # D Dg: 一路 = all the way, 到處 = everywhere, 四處 = around, 處處 = everywhere, 當場 = on the spot
286 # D Dh: 如何 = how, 一起 = together, 更 = more, 分別 = respectively, 這麼 = so
287 # Di = post-verbal
288 # D Dj: 為什麼 = why, 是否 = whether, 怎麼 = how, 為何 = why, 有沒有 = is there?
289 # Dk = sentence-initial
290 # D Dk: 結果 = result, 那 = then, 據說 = reportedly, 據了解 = it is understood that, 那麼 = then
291 'Daa' => ['pos' => 'adv'],
292 'Dab' => ['pos' => 'adv', 'other' => {'subpos' => 'ab'}],
293 'Dbaa' => ['pos' => 'adv', 'other' => {'subpos' => 'baa'}],
294 'Dbab' => ['pos' => 'adv', 'other' => {'subpos' => 'bab'}],
295 'Dbb' => ['pos' => 'adv', 'other' => {'subpos' => 'bb'}],
296 'Dbc' => ['pos' => 'adv', 'other' => {'subpos' => 'bc'}],
297 'Dc' => ['pos' => 'adv', 'polarity' => 'neg'],
298 'Dd' => ['pos' => 'adv', 'other' => {'subpos' => 'd'}],
299 'Dfa' => ['pos' => 'adv', 'other' => {'subpos' => 'fa'}],
300 'Dfb' => ['pos' => 'adv', 'other' => {'subpos' => 'fb'}],
301 'Dg' => ['pos' => 'adv', 'other' => {'subpos' => 'g'}],
302 'Dh' => ['pos' => 'adv', 'other' => {'subpos' => 'h'}],
303 'Dj' => ['pos' => 'adv', 'prontype' => 'int'],
304 'Dk' => ['pos' => 'adv', 'other' => {'subpos' => 'k'}],
305 # measure word, quantifier
306 # DM DM: 一個 yīgè = a, 這個 zhège = this one, 這種 zhèzhǒng = this kind, 個 gè, 一種 yīzhǒng = one kind
307 ###!!! There ought to be a better solution!
308 'DM' => ['pos' => 'adj', 'nountype' => 'class'],
309 # postposition (qian = before)
310 # Ng Ng: 中 zhōng = middle, 時 shí = during, 後 hòu = after, 上 shàng = on, 前 qián = ago
311 'Ng' => ['pos' => 'adp', 'adpostype' => 'post'],
312 # preposition (66 kinds, 66 different tags)
313 # P P01: 承, 似, 承蒙, 為, 深為 (like, thanks to, for) max 3 occ.
314 # P P02: 被, 受, 為, 深受, 備受 (for, by) max 588 occ.
315 # P P03: 為 wèi, 為了 wèile (for, in order to) max 354 occ.
316 # P P04: 給 gěi, 對 duì (to, for) max 132 occ.
317 # P P06: 由 yóu, 遭, 改由, 每逢 (from, by, instead of) max 492 occ.
318 # P P07: 把 bǎ, 將 jiāng (to) max 537 occ.
319 # P P08: 拿 ná, 拿著, 直至 (take, hold, until, up to) max 8 occ.
320 # P P09: 管, 尤以 () max 2 occ.
321 # P P10: 為, 作 (for, as) max 6 occ.
322 # P P11: 以 yǐ (with) max 990 occ.
323 # P P12: 自從 (since) max 23 occ.
324 # P P13: 等, 待, 逢, 每當, 趁 (wait, etc., whenever) max 19 occ.
325 # P P14: 有 yǒu (there is) max 11 occ.
326 # P P15: 離, 距, 距離, 臨, 去 (from, off, apart) max 21 occ.
327 # P P16: 當 dāng (when, as) max 150 occ.
328 # P P17: 打從, 打 dǎ () max 1 occ.
329 # P P18: 直到, 等到, 直至, 及至 (until) max 44 occ.
330 # P P19: 從 cóng (from) max 514 occ.
331 # P P20: 就 jiù (on) max 37 occ.
332 # P P21: 在 zài (in, at) max 3616 occ.
333 # P P22: 繼 jì (following) max 10 occ.
334 # P P23: 於 yú (to, in, on) max 569 occ.
335 # P P24: 沿著 yánzhe, 沿, 跟, 延著 (along) max 29 occ.
336 # P P25: 順著 shùnzhe, 循, 循著, 順 (following, along) max 5 occ.
337 # P P26: 經 jīng, 經過, 經由, 業經, 一經 (after) max 66 occ.
338 # P P27: 靠 kào, 靠著 (by, near, against) max 24 occ.
339 # P P28: 朝 cháo, 假, 朝著 (towards) max 8 occ.
340 # P P29: 朝 cháo, 朝著 (towards) max 2 occ.
341 # P P30: 往 wǎng (to, towards) max 71 occ.
342 # P P31: 對 duì, 針對, 對著, 針對了 (to, against) max 784 occ.
343 # P P32: 對於 duìyú (for, about, regarding) max 110 occ.
344 # P P35: 與 yǔ, 和 hé (versus, and, with) max 424 occ.
345 # P P36: 代, 跟著 (on behalf of, following, in accord with) max 3 occ.
346 # P P37: 替 tì, 幫 bāng (for, on behalf of, with the help of) max 62 occ.
347 # P P38: 藉 jí, 藉著, 憑, 藉由, 憑藉 (by means of, through, based on, with) max 20 occ.
348 # P P39: 用 yòng, 透過 (using, through) max 191 occ.
349 # P P40: 基於 (because of, due to) max 15 occ.
350 # P P41: 至於 zhìyú, 有關, 關於 (touching, as for, with respect to) max 95 occ.
351 # P P42: 依 yī, 按, 照, 依著, 照著 (according to) max 75 occ.
352 # P P43: 據 jù, 根據, 依據, 依照, 按照 (according to) max 97 occ.
353 # P P44: 依循, 比照, 仿照 (following, in contrast to, cf.) max 2 occ.
354 # P P45: 逐 (individually, one by one) max 2 occ.
355 # P P46: 視 shì, 每隔 (depending on) max 26 occ.
356 # P P47: 如 rú (according to) max 164 occ.
357 # P P48: 有如 yǒurú, 一如, 如同, 似, 猶如 (like) max 7 occ.
358 # P P49: 比 bǐ, 較, 比起, 相對於 (comparison particle) max 140 occ.
359 # P P50: 除了 chúle, 除 chú (apart from, except) max 129 occ.
360 # P P51: 連同 (together with, along of) max 1 occ.
361 # P P52: 因 yīn, 因著 yīnzhe, 因為 yīnwèi (because of) max 7 occ.
362 # P P53: 途經, 隨著 (via) max 2 occ.
363 # P P54: 例如 lìrú, 譬如, 比如, 諸如, 誠如 (for example, such as) max 61 occ.
364 # P P55: 像 xiàng, 好像 (like) max 169 occ.
365 # P P58: 隨著 suízhe, 隨 (along with, along of) max 52 occ.
366 # P P59: 自 zì (from, since) max 129 occ.
367 # P P60: 遭 zāo, 慘遭, 險遭, 遭到, 遭受 (missing, suffering from) max 47 occ.
368 # P P61: 到 dào, 至, 迄, 到了, 去 (to, up to, until) max 334 occ.
369 # P P62: 向 xiàng, 向著 xiàngzhe (to, toward) max 355 occ.
370 # P P63: 跟 gēn, 跟著 gēnzhe (with) max 141 occ.
371 # P P64: 隨同, 偕 (accompanying) max 4 occ.
372 # P P65: 隔 gé (at a distance from, after an interval of) max 3 occ.
373 # P P66: 為 wèi (for) max 9 occ.
374 'P01' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P01'}],
375 'P02' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P02'}],
376 'P03' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P03'}],
377 'P04' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P04'}],
378 'P05' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P05'}],
379 # P06 is default because it also exists with P1, P2 and +part.
380 'P06' => ['pos' => 'adp', 'adpostype' => 'prep'],
381 'P07' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P07'}],
382 'P08' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P08'}],
383 'P09' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P09'}],
384 'P10' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P10'}],
385 'P11' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P11'}],
386 'P12' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P12'}],
387 'P13' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P13'}],
388 'P14' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P14'}],
389 'P15' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P15'}],
390 'P16' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P16'}],
391 'P17' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P17'}],
392 'P18' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P18'}],
393 'P19' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P19'}],
394 'P20' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P20'}],
395 'P21' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P21'}],
396 'P22' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P22'}],
397 'P23' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P23'}],
398 'P24' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P24'}],
399 'P25' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P25'}],
400 'P26' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P26'}],
401 'P27' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P27'}],
402 'P28' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P28'}],
403 'P29' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P29'}],
404 'P30' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P30'}],
405 'P31' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P31'}],
406 'P32' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P32'}],
407 'P33' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P33'}],
408 'P34' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P34'}],
409 'P35' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P35'}],
410 'P36' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P36'}],
411 'P37' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P37'}],
412 'P38' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P38'}],
413 'P39' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P39'}],
414 'P40' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P40'}],
415 'P41' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P41'}],
416 'P42' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P42'}],
417 'P43' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P43'}],
418 'P44' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P44'}],
419 'P45' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P45'}],
420 'P46' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P46'}],
421 'P47' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P47'}],
422 'P48' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P48'}],
423 'P49' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P49'}],
424 'P50' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P50'}],
425 'P51' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P51'}],
426 'P52' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P52'}],
427 'P53' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P53'}],
428 'P54' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P54'}],
429 'P55' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P55'}],
430 'P56' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P56'}],
431 'P57' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P57'}],
432 'P58' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P58'}],
433 'P59' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P59'}],
434 'P60' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P60'}],
435 'P61' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P61'}],
436 'P62' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P62'}],
437 'P63' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P63'}],
438 'P64' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P64'}],
439 'P65' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P65'}],
440 'P66' => ['pos' => 'adp', 'adpostype' => 'prep', 'other' => {'subpos' => 'P66'}],
441 # conjunction
442 # C Caa: 、, 和 = and, 及 = and, 與 = versus, 或 = or
443 # C Caa[P1]: 從 = from, 又 = again, 既 = already, 由 = from, 或 = or
444 # C Caa[P2]: 又 = again, 到 = to, 至 = to, 或 = or, 也 = also
445 # C Cab: 等 = etc., 等等 = and so on, 之類 = the class, 什麼的 = something, 、
446 # C Cbaa: 因為 = because, 如果 = in case, 因 = because, 雖然 = though, 若 = if
447 # C Cbab: 的話 = if, 應該 = should, 而 = while, 能 = can/able, 並 = and
448 # Cbb = following a subject
449 # C Cbba: 由於 = due to, 雖 = although, 連 = even though, 既然 = since, 就是 = that
450 # C Cbbb: 不但 = not only, 不僅 = not only, 一方面 = on the one hand, 首先 = first of all, 二 = two
451 # Cbc = sentence-initial
452 # C Cbca: 而 = and, 但 = but, 因此 = as such, 所以 = and so, 但是 = but
453 # C Cbcb: 並 = and, 而且 = and, 且 = and, 並且 = and, 反而 = instead
454 'Caa' => ['pos' => 'conj', 'conjtype' => 'coor'],
455 'Cab' => ['pos' => 'conj', 'conjtype' => 'coor', 'other' => {'subpos' => 'ab'}],
456 'Cbaa' => ['pos' => 'conj', 'conjtype' => 'sub'],
457 'Cbab' => ['pos' => 'conj', 'conjtype' => 'sub', 'other' => {'subpos' => 'bab'}],
458 'Cbba' => ['pos' => 'conj', 'conjtype' => 'sub', 'other' => {'subpos' => 'bba'}],
459 'Cbbb' => ['pos' => 'conj', 'conjtype' => 'sub', 'other' => {'subpos' => 'bbb'}],
460 'Cbca' => ['pos' => 'conj', 'conjtype' => 'coor', 'other' => {'subpos' => 'bca'}],
461 'Cbcb' => ['pos' => 'conj', 'conjtype' => 'coor', 'other' => {'subpos' => 'bcb'}],
462 # the "de" particle (two kinds)
463 # DE DE: 的 de = of, 之 zhī = of, 得 dé = get, 地 de = ground/land/earth (tagging error?)
464 # DE Di: 了 le, 著 zhe, 過 guò, 起來 qǐlái, 起 qǐ
465 'DE' => ['pos' => 'part', 'case' => 'gen'],
466 'Di' => ['pos' => 'part', 'case' => 'gen', 'other' => {'subpos' => 'Di'}],
467 # particle
468 # T Ta: 了 le, 的 de, 來 lái, 去 qù, 嘛 ma
469 # T Tb: 而已 éryǐ, 罷了 bàle, 沒有 méiyǒu, 也好 yěhǎo, 好了 hǎole
470 # T Tc: 呢 ne, 吧 ba, 啊 a, 呀 ya, 啦 la
471 # T Td: 嗎 ma, 來 lái, 去 qù, 與否 yǔfǒu, 矣 yǐ
472 'Ta' => ['pos' => 'part'],
473 'Tb' => ['pos' => 'part', 'other' => {'subpos' => 'b'}],
474 'Tc' => ['pos' => 'part', 'other' => {'subpos' => 'c'}],
475 'Td' => ['pos' => 'part', 'other' => {'subpos' => 'd'}],
476 # interjection
477 'I' => ['pos' => 'int']
478 },
479 'encode_map' =>
480 {
481 'pos' => { 'noun' => { 'nountype' => { 'com' => { 'other/subpos' => { 'ab' => 'Nab',
482 'ac' => 'Nac',
483 'ad' => 'Nad',
484 'aea' => 'Naea',
485 'aeb' => 'Naeb',
486 '@' => 'Naa' }},
487 'prop' => { 'other/subpos' => { 'bc' => 'Nbc',
488 '@' => 'Nba' }},
489 'class' => { 'other/subpos' => { 'fc' => 'Nfc',
490 'fd' => 'Nfd',
491 'fe' => 'Nfe',
492 'fg' => 'Nfg',
493 'fh' => 'Nfh',
494 'fi' => 'Nfi',
495 '@' => 'Nfa' }},
496 '@' => { 'advtype' => { 'loc' => { 'other/subpos' => { 'cb' => 'Ncb',
497 'cc' => 'Ncc',
498 'cda' => 'Ncda',
499 'cdb' => 'Ncdb',
500 'ce' => 'Nce',
501 '@' => 'Nca' }},
502 'tim' => { 'other/subpos' => { 'daab' => 'Ndaab',
503 'daac' => 'Ndaac',
504 'daad' => 'Ndaad',
505 'daba' => 'Ndaba',
506 'dabb' => 'Ndabb',
507 'dabc' => 'Ndabc',
508 'dabd' => 'Ndabd',
509 'dabe' => 'Ndabe',
510 'dabf' => 'Ndabf',
511 'dbb' => 'Ndbb',
512 'dc' => 'Ndc',
513 'dda' => 'Ndda',
514 'ddb' => 'Nddb',
515 'ddc' => 'Nddc',
516 '@' => 'Ndaaa' }},
517 '@' => { 'prontype' => { 'prs' => { 'reflex' => { 'yes' => 'Nhab',
518 '@' => { 'polite' => { 'form' => 'Nhac',
519 '@' => 'Nhaa' }}}},
520 'int' => 'Nhb',
521 'prn' => 'Nhc',
522 '@' => { 'other/subpos' => { 'v2' => 'Nv2',
523 'v3' => 'Nv3',
524 'v4' => 'Nv4',
525 '@' => 'Nv1' }}}}}}}},
526 'adj' => { 'prontype' => { 'dem' => 'Nep',
527 'prn' => { 'other/subpos' => { 'qb' => 'Neqb',
528 's' => 'Nes',
529 '@' => 'Neqa' }},
530 '@' => { 'nountype' => { 'class' => 'DM',
531 '@' => 'A' }}}},
532 'num' => 'Neu',
533 'verb' => { 'other/subpos' => { 'A11' => 'VA11',
534 'A12' => 'VA12',
535 'A13' => 'VA13',
536 'A2' => 'VA2',
537 'A3' => 'VA3',
538 'A4' => 'VA4',
539 'B11' => 'VB11',
540 'B12' => 'VB12',
541 'B2' => 'VB2',
542 'C1' => 'VC1',
543 'C2' => 'VC2',
544 'C31' => 'VC31',
545 'C32' => 'VC32',
546 'C33' => 'VC33',
547 'D1' => 'VD1',
548 'D2' => 'VD2',
549 'E11' => 'VE11',
550 'E12' => 'VE12',
551 'E2' => 'VE2',
552 'F1' => 'VF1',
553 'F2' => 'VF2',
554 'G1' => 'VG1',
555 'G2' => 'VG2',
556 'H11' => 'VH11',
557 'H12' => 'VH12',
558 'H13' => 'VH13',
559 'H14' => 'VH14',
560 'H15' => 'VH15',
561 'H16' => 'VH16',
562 'H17' => 'VH17',
563 'H21' => 'VH21',
564 'H22' => 'VH22',
565 'I1' => 'VI1',
566 'I2' => 'VI2',
567 'I3' => 'VI3',
568 'J1' => 'VJ1',
569 'J2' => 'VJ2',
570 'J3' => 'VJ3',
571 'K1' => 'VK1',
572 'K2' => 'VK2',
573 'L1' => 'VL1',
574 'L2' => 'VL2',
575 'L3' => 'VL3',
576 'L4' => 'VL4',
577 '_11' => 'V_11',
578 '_12' => 'V_12',
579 '_2' => 'V_2',
580 '@' => 'VB11' }},
581 'adv' => { 'prontype' => { 'int' => 'Dj',
582 '@' => { 'polarity' => { 'neg' => 'Dc',
583 '@' => { 'other/subpos' => { 'ab' => 'Dab',
584 'baa' => 'Dbaa',
585 'bab' => 'Dbab',
586 'bb' => 'Dbb',
587 'bc' => 'Dbc',
588 'd' => 'Dd',
589 'fa' => 'Dfa',
590 'fb' => 'Dfb',
591 'g' => 'Dg',
592 'h' => 'Dh',
593 'k' => 'Dk',
594 '@' => 'Daa' }}}}}},
595 'adp' => { 'adpostype' => { 'prep' => { 'other/subpos' => { 'P01' => 'P01',
596 'P02' => 'P02',
597 'P03' => 'P03',
598 'P04' => 'P04',
599 'P05' => 'P05',
600 'P07' => 'P07',
601 'P08' => 'P08',
602 'P09' => 'P09',
603 'P10' => 'P10',
604 'P11' => 'P11',
605 'P12' => 'P12',
606 'P13' => 'P13',
607 'P14' => 'P14',
608 'P15' => 'P15',
609 'P16' => 'P16',
610 'P17' => 'P17',
611 'P18' => 'P18',
612 'P19' => 'P19',
613 'P20' => 'P20',
614 'P21' => 'P21',
615 'P22' => 'P22',
616 'P23' => 'P23',
617 'P24' => 'P24',
618 'P25' => 'P25',
619 'P26' => 'P26',
620 'P27' => 'P27',
621 'P28' => 'P28',
622 'P29' => 'P29',
623 'P30' => 'P30',
624 'P31' => 'P31',
625 'P32' => 'P32',
626 'P33' => 'P33',
627 'P34' => 'P34',
628 'P35' => 'P35',
629 'P36' => 'P36',
630 'P37' => 'P37',
631 'P38' => 'P38',
632 'P39' => 'P39',
633 'P40' => 'P40',
634 'P41' => 'P41',
635 'P42' => 'P42',
636 'P43' => 'P43',
637 'P44' => 'P44',
638 'P45' => 'P45',
639 'P46' => 'P46',
640 'P47' => 'P47',
641 'P48' => 'P48',
642 'P49' => 'P49',
643 'P50' => 'P50',
644 'P51' => 'P51',
645 'P52' => 'P52',
646 'P53' => 'P53',
647 'P54' => 'P54',
648 'P55' => 'P55',
649 'P56' => 'P56',
650 'P57' => 'P57',
651 'P58' => 'P58',
652 'P59' => 'P59',
653 'P60' => 'P60',
654 'P61' => 'P61',
655 'P62' => 'P62',
656 'P63' => 'P63',
657 'P64' => 'P64',
658 'P65' => 'P65',
659 'P66' => 'P66',
660 # P06 is default because it also exists with P1, P2 and +part.
661 '@' => 'P06' }},
662 'post' => 'Ng' }},
663 'conj' => { 'conjtype' => { 'coor' => { 'other/subpos' => { 'ab' => 'Cab',
664 'bca' => 'Cbca',
665 'bcb' => 'Cbcb',
666 '@' => 'Caa' }},
667 'sub' => { 'other/subpos' => { 'bab' => 'Cbab',
668 'bba' => 'Cbba',
669 'bbb' => 'Cbbb',
670 '@' => 'Cbaa' }}}},
671 'part' => { 'case' => { 'gen' => { 'other/subpos' => { 'Di' => 'Di',
672 '@' => 'DE' }},
673 '@' => { 'other/subpos' => { 'b' => 'Tb',
674 'c' => 'Tc',
675 'd' => 'Td',
676 '@' => 'Ta' }}}},
677 'int' => 'I' }
678 }
679 );
680 # PAIRED TOKENS ####################
681 # Certain tokens (e.g. some conjunctions) occur in pairs.
682 # This feature tells whether this is the first or the second token in the pair.
683 # Example: 又 yòu = also; it can be used in pairs: "又 X 又 Y" means "both X and Y".
684 # The first 又 will be tagged Caa[P1]. The second 又 will be tagged Caa[P2].
685 ###!!! At the moment we abuse the 'puncside' feature for this purpose.
686 ###!!! We may want to rename the feature in future because in this case we do not work with punctuation.
687 $atoms{pair} = $self->create_simple_atom
688 (
689 'intfeature' => 'puncside',
690 'simple_decode_map' =>
691 {
692 'P1' => 'ini',
693 'P2' => 'fin'
694 }
695 );
696 # +SPO ####################
697 # An undocumented and rare feature of nouns.
698 # +SPV ####################
699 # An undocumented and rare feature of verbs.
700 # +part ####################
701 # An undocumented and rare feature of prepositions.
702 $atoms{undoc} = $self->create_atom
703 (
704 'surfeature' => 'undoc',
705 'decode_map' =>
706 {
707 '+SPO' => ['other' => {'undoc' => 'spo'}],
708 '+SPV' => ['other' => {'undoc' => 'spv'}],
709 '+part' => ['other' => {'undoc' => 'part'}]
710 },
711 'encode_map' =>
712 {
713 'other/undoc' => { 'spo' => '+SPO',
714 'spv' => '+SPV',
715 'part' => '+part' }
716 }
717 );
718 # +ASP ####################
719 # A verb with incorporated aspect morpheme 了 le.
720 # 走了過來 zǒuliǎoguòlái = go over
721 # 走 zǒu = go
722 # 走了 zǒuliǎo = gone (action completed)
723 $atoms{asp} = $self->create_simple_atom
724 (
725 'intfeature' => 'aspect',
726 'simple_decode_map' =>
727 {
728 '+ASP' => 'perf'
729 }
730 );
731 # +NEG ####################
732 # A verb with incorporated negative morpheme 不 bù.
733 # 回不去 huíbùqù = return+not+go = not return there
734 # 回不來 huíbùlái = return+not+come = not return here
735 $atoms{neg} = $self->create_simple_atom
736 (
737 'intfeature' => 'polarity',
738 'simple_decode_map' =>
739 {
740 '+NEG' => 'neg'
741 }
742 );
743 # +DE ####################
744 # A verb with incorporated morpheme 得 dé = get.
745 # 得 is a particle used after a verb or an adjective to express possibility or capability.
746 # 看得見 kàndéjiàn = look+get+view = be able to see
747 # 拿得到 nádédào = take+get+to = get them
748 # 做得好 zuòdéhǎo = do+get+good = do well
749 $atoms{de} = $self->create_atom
750 (
751 'surfeature' => 'de',
752 'decode_map' =>
753 {
754 '+DE' => ['other' => {'de' => '1'}]
755 },
756 'encode_map' =>
757 {
758 'other/de' => { '1' => '+DE' }
759 }
760 );
761 # MERGED ATOM TO DECODE ANY FEATURE VALUE ####################
762 my @fatoms = map {$atoms{$_}} (@{$self->features_all()});
763 $atoms{feature} = $self->create_merged_atom
764 (
765 'surfeature' => 'feature',
766 'atoms' => \@fatoms
767 );
768 return \%atoms;
769 }
770  
771  
772  
773 #------------------------------------------------------------------------------
774 # Creates the list of all surface CoNLL features that can appear in the FEATS
775 # column. This list will be used in decode().
776 #------------------------------------------------------------------------------
777 sub _create_features_all
778 {
779 my $self = shift;
780 my @features = ('pair', 'undoc', 'neg', 'de', 'asp');
781 return \@features;
782 }
783  
784  
785  
786 #------------------------------------------------------------------------------
787 # Creates the list of surface CoNLL features that can appear in the FEATS
788 # column with particular parts of speech. This list will be used in encode().
789 #------------------------------------------------------------------------------
790 sub _create_features_pos
791 {
792 my $self = shift;
793 my %features =
794 (
795 );
796 return \%features;
797 }
798  
799  
800  
801 #------------------------------------------------------------------------------
802 # Decodes a physical tag (string) and returns the corresponding feature
803 # structure.
804 #------------------------------------------------------------------------------
805 sub decode
806 {
807 my $self = shift;
808 my $tag = shift;
809 my $fs = Lingua::Interset::FeatureStructure->new();
810 $fs->set_tagset('zh::conll');
811 my $atoms = $self->atoms();
812 # Three components: pos, subpos, features (always empty).
813 # example: N\tNaa\t_
814 my ($pos, $subpos, $dummy_features) = split(/\s+/, $tag);
815 my @bracket_features;
816 if($subpos =~ s/\[(.*)\]//)
817 {
818 @bracket_features = split(/,/, $1);
819 }
820 $atoms->{pos}->decode_and_merge_hard($subpos, $fs);
821 foreach my $bf (@bracket_features)
822 {
823 $atoms->{feature}->decode_and_merge_hard($bf, $fs);
824 }
825 return $fs;
826 }
827  
828  
829  
830 #------------------------------------------------------------------------------
831 # Takes feature structure and returns the corresponding physical tag (string).
832 #------------------------------------------------------------------------------
833 sub encode
834 {
835 my $self = shift;
836 my $fs = shift; # Lingua::Interset::FeatureStructure
837 my $atoms = $self->atoms();
838 my $subpos = $atoms->{pos}->encode($fs);
839 my $pos = $subpos =~ m/^(DE|Di)$/ ? 'DE' : $subpos eq 'DM' ? 'DM' : $subpos =~ m/^(N[eg])/ ? $1 : substr($subpos, 0, 1);
840 my @bracket_feature_names = @{$self->features_all()};
841 my @features;
842 foreach my $bfn (@bracket_feature_names)
843 {
844 my $value = $atoms->{$bfn}->encode($fs);
845 unless($value eq '')
846 {
847 push(@features, $value);
848 }
849 }
850 if(@features)
851 {
852 $subpos .= '['.join(',', @features).']';
853 }
854 # Dc is implicitly negative and it does not take the explicit [+NEG] feature.
855 $subpos =~ s/Dc\[\+NEG\]/Dc/;
856 my $tag = "$pos\t$subpos\t_";
857 return $tag;
858 }
859  
860  
861  
862 #------------------------------------------------------------------------------
863 # Returns reference to list of known tags.
864 # Tags were collected from the corpus, 294 distinct tags found.
865 # Cleaned up erroneous instances (e.g. with "[P2}" instead of "[P2]").
866 # 283 tags survived.
867 #------------------------------------------------------------------------------
868 sub list
869 {
870 my $self = shift;
871 my $list = <<end_of_list
872 A\tA\t_
873 C\tCaa\t_
874 C\tCaa[P1]\t_
875 C\tCaa[P2]\t_
876 C\tCab\t_
877 C\tCbaa\t_
878 C\tCbab\t_
879 C\tCbba\t_
880 C\tCbbb\t_
881 C\tCbca\t_
882 C\tCbcb\t_
883 D\tDaa\t_
884 D\tDab\t_
885 D\tDbaa\t_
886 D\tDbab\t_
887 D\tDbb\t_
888 D\tDbc\t_
889 D\tDc\t_
890 D\tDd\t_
891 D\tDfa\t_
892 D\tDfb\t_
893 D\tDg\t_
894 D\tDh\t_
895 D\tDj\t_
896 D\tDk\t_
897 DE\tDE\t_
898 DE\tDi\t_
899 DM\tDM\t_
900 I\tI\t_
901 Ne\tNep\t_
902 Ne\tNeqa\t_
903 Ne\tNeqb\t_
904 Ne\tNes\t_
905 Ne\tNeu\t_
906 Ng\tNg\t_
907 N\tNaa\t_
908 N\tNaa[+SPO]\t_
909 N\tNab\t_
910 N\tNab[+SPO]\t_
911 N\tNac\t_
912 N\tNac[+SPO]\t_
913 N\tNad\t_
914 N\tNad[+SPO]\t_
915 N\tNaea\t_
916 N\tNaeb\t_
917 N\tNba\t_
918 N\tNbc\t_
919 N\tNca\t_
920 N\tNcb\t_
921 N\tNcc\t_
922 N\tNcda\t_
923 N\tNcdb\t_
924 N\tNce\t_
925 N\tNdaaa\t_
926 N\tNdaab\t_
927 N\tNdaac\t_
928 N\tNdaad\t_
929 N\tNdaba\t_
930 N\tNdabb\t_
931 N\tNdabc\t_
932 N\tNdabd\t_
933 N\tNdabe\t_
934 N\tNdabf\t_
935 N\tNdbb\t_
936 N\tNdc\t_
937 N\tNdda\t_
938 N\tNddb\t_
939 N\tNddc\t_
940 N\tNfa\t_
941 N\tNfc\t_
942 N\tNfd\t_
943 N\tNfe\t_
944 N\tNfg\t_
945 N\tNfh\t_
946 N\tNfi\t_
947 N\tNhaa\t_
948 N\tNhab\t_
949 N\tNhac\t_
950 N\tNhb\t_
951 N\tNhc\t_
952 N\tNv1\t_
953 N\tNv2\t_
954 N\tNv3\t_
955 N\tNv4\t_
956 P\tP01\t_
957 P\tP02\t_
958 P\tP03\t_
959 P\tP04\t_
960 P\tP06\t_
961 P\tP06[P1]\t_
962 P\tP06[P2]\t_
963 P\tP06[+part]\t_
964 P\tP07\t_
965 P\tP08\t_
966 P\tP08[+part]\t_
967 P\tP09\t_
968 P\tP10\t_
969 P\tP11\t_
970 P\tP11[P1]\t_
971 P\tP11[P2]\t_
972 P\tP11[+part]\t_
973 P\tP12\t_
974 P\tP13\t_
975 P\tP14\t_
976 P\tP15\t_
977 P\tP16\t_
978 P\tP17\t_
979 P\tP18\t_
980 P\tP18[+part]\t_
981 P\tP19\t_
982 P\tP19[P1]\t_
983 P\tP19[P2]\t_
984 P\tP19[+part]\t_
985 P\tP20\t_
986 P\tP20[+part]\t_
987 P\tP21\t_
988 P\tP21[+part]\t_
989 P\tP22\t_
990 P\tP23\t_
991 P\tP24\t_
992 P\tP25\t_
993 P\tP26\t_
994 P\tP27\t_
995 P\tP28\t_
996 P\tP29\t_
997 P\tP30\t_
998 P\tP31\t_
999 P\tP31[P1]\t_
1000 P\tP31[P2]\t_
1001 P\tP31[+part]\t_
1002 P\tP32\t_
1003 P\tP32[+part]\t_
1004 P\tP35\t_
1005 P\tP35[+part]\t_
1006 P\tP36\t_
1007 P\tP37\t_
1008 P\tP38\t_
1009 P\tP39\t_
1010 P\tP40\t_
1011 P\tP41\t_
1012 P\tP42\t_
1013 P\tP42[+part]\t_
1014 P\tP43\t_
1015 P\tP44\t_
1016 P\tP45\t_
1017 P\tP46\t_
1018 P\tP46[+part]\t_
1019 P\tP47\t_
1020 P\tP48\t_
1021 P\tP48[+part]\t_
1022 P\tP49\t_
1023 P\tP50\t_
1024 P\tP51\t_
1025 P\tP52\t_
1026 P\tP53\t_
1027 P\tP54\t_
1028 P\tP55\t_
1029 P\tP55[+part]\t_
1030 P\tP58\t_
1031 P\tP59\t_
1032 P\tP59[+part]\t_
1033 P\tP60\t_
1034 P\tP61\t_
1035 P\tP62\t_
1036 P\tP63\t_
1037 P\tP64\t_
1038 P\tP65\t_
1039 P\tP66\t_
1040 T\tTa\t_
1041 T\tTb\t_
1042 T\tTc\t_
1043 T\tTd\t_
1044 V\tV_11\t_
1045 V\tV_12\t_
1046 V\tV_2\t_
1047 V\tVA11\t_
1048 V\tVA11[+ASP]\t_
1049 V\tVA11[+NEG]\t_
1050 V\tVA12\t_
1051 V\tVA12[+NEG]\t_
1052 V\tVA12[+SPV]\t_
1053 V\tVA13\t_
1054 V\tVA13[+ASP]\t_
1055 V\tVA2\t_
1056 V\tVA2[+ASP]\t_
1057 V\tVA2[+SPV]\t_
1058 V\tVA3\t_
1059 V\tVA3[+ASP]\t_
1060 V\tVA4\t_
1061 V\tVA4[+ASP]\t_
1062 V\tVA4[+NEG]\t_
1063 V\tVA4[+NEG,+ASP]\t_
1064 V\tVA4[+SPV]\t_
1065 V\tVB11\t_
1066 V\tVB11[+ASP]\t_
1067 V\tVB11[+DE]\t_
1068 V\tVB11[+NEG]\t_
1069 V\tVB11[+NEG,+ASP]\t_
1070 V\tVB11[+SPV]\t_
1071 V\tVB12\t_
1072 V\tVB12[+ASP]\t_
1073 V\tVB12[+NEG]\t_
1074 V\tVB2\t_
1075 V\tVB2[+ASP]\t_
1076 V\tVB2[+NEG]\t_
1077 V\tVC1\t_
1078 V\tVC1[+NEG]\t_
1079 V\tVC1[+SPV]\t_
1080 V\tVC2\t_
1081 V\tVC2[+ASP]\t_
1082 V\tVC2[+DE]\t_
1083 V\tVC2[+NEG]\t_
1084 V\tVC2[+SPV]\t_
1085 V\tVC31\t_
1086 V\tVC31[+ASP]\t_
1087 V\tVC31[+DE]\t_
1088 V\tVC31[+DE,+ASP]\t_
1089 V\tVC31[+NEG]\t_
1090 V\tVC31[+SPV]\t_
1091 V\tVC32\t_
1092 V\tVC32[+DE]\t_
1093 V\tVC32[+SPV]\t_
1094 V\tVC33\t_
1095 V\tVD1\t_
1096 V\tVD2\t_
1097 V\tVD2[+NEG]\t_
1098 V\tVE11\t_
1099 V\tVE12\t_
1100 V\tVE2\t_
1101 V\tVE2[+DE]\t_
1102 V\tVE2[+NEG]\t_
1103 V\tVE2[+SPV]\t_
1104 V\tVF1\t_
1105 V\tVF2\t_
1106 V\tVG1\t_
1107 V\tVG1[+NEG]\t_
1108 V\tVG2\t_
1109 V\tVG2[+DE]\t_
1110 V\tVG2[+NEG]\t_
1111 V\tVH11\t_
1112 V\tVH11[+ASP]\t_
1113 V\tVH11[+DE]\t_
1114 V\tVH11[+NEG]\t_
1115 V\tVH11[+SPV]\t_
1116 V\tVH12\t_
1117 V\tVH12[+ASP]\t_
1118 V\tVH13\t_
1119 V\tVH14\t_
1120 V\tVH15\t_
1121 V\tVH15[+NEG]\t_
1122 V\tVH16\t_
1123 V\tVH16[+ASP]\t_
1124 V\tVH16[+NEG]\t_
1125 V\tVH16[+SPV]\t_
1126 V\tVH17\t_
1127 V\tVH21\t_
1128 V\tVH21[+ASP]\t_
1129 V\tVH21[+DE]\t_
1130 V\tVH21[+NEG]\t_
1131 V\tVH22\t_
1132 V\tVI1\t_
1133 V\tVI2\t_
1134 V\tVI2[+ASP]\t_
1135 V\tVI3\t_
1136 V\tVJ1\t_
1137 V\tVJ1[+DE]\t_
1138 V\tVJ1[+NEG]\t_
1139 V\tVJ2\t_
1140 V\tVJ2[+NEG]\t_
1141 V\tVJ2[+SPV]\t_
1142 V\tVJ3\t_
1143 V\tVJ3[+DE]\t_
1144 V\tVJ3[+NEG]\t_
1145 V\tVK1\t_
1146 V\tVK1[+ASP]\t_
1147 V\tVK1[+DE]\t_
1148 V\tVK1[+NEG]\t_
1149 V\tVK2\t_
1150 V\tVK2[+NEG]\t_
1151 V\tVL1\t_
1152 V\tVL2\t_
1153 V\tVL3\t_
1154 V\tVL4\t_
1155 end_of_list
1156 ;
1157 # Protect from editors that replace tabs by spaces.
1158 $list =~ s/ \s+/\t/sg;
1159 my @list = split(/\r?\n/, $list);
1160 return \@list;
1161 }
1162  
1163  
1164  
1165 1;
1166  
1167 __END__
1168  
1169 =pod
1170  
1171 =encoding UTF-8
1172  
1173 =head1 NAME
1174  
1175 Lingua::Interset::Tagset::ZH::Conll - Driver for the Chinese tagset of the CoNLL 2006 & 2007 Shared Tasks (derived from the Academia Sinica Treebank).
1176  
1177 =head1 VERSION
1178  
1179 version 3.014
1180  
1181 =head1 SYNOPSIS
1182  
1183 use Lingua::Interset::Tagset::ZH::Conll;
1184 my $driver = Lingua::Interset::Tagset::ZH::Conll->new();
1185 my $fs = $driver->decode("N\tNaa\t_");
1186  
1187 or
1188  
1189 use Lingua::Interset qw(decode);
1190 my $fs = decode('zh::conll', "N\tNaa\t_");
1191  
1192 =head1 DESCRIPTION
1193  
1194 Interset driver for the Chinese tagset of the CoNLL 2006 and 2007 Shared Tasks.
1195 CoNLL tagsets in Interset are traditionally three values separated by tabs.
1196 The values come from the CoNLL columns CPOS, POS and FEAT. For Chinese,
1197 these values are derived from the tagset of the Academia Sinica Treebank
1198 and the FEAT column is always empty.
1199  
1200 Some documentation can be found here:
1201 L<http://ckip.iis.sinica.edu.tw/CKIP/engversion/20corpus.htm>.
1202  
1203 =head1 SEE ALSO
1204  
1205 L<Lingua::Interset>,
1206 L<Lingua::Interset::Tagset>,
1207 L<Lingua::Interset::Tagset::Conll>,
1208 L<Lingua::Interset::FeatureStructure>
1209  
1210 =head1 AUTHOR
1211  
1212 Dan Zeman <zeman@ufal.mff.cuni.cz>
1213  
1214 =head1 COPYRIGHT AND LICENSE
1215  
1216 This software is copyright (c) 2019 by Univerzita Karlova (Charles University).
1217  
1218 This is free software; you can redistribute it and/or modify it under
1219 the same terms as the Perl 5 programming language system itself.
1220  
1221 =cut