@@ -47,25 +47,32 @@ def process_node(self, node):
47
47
return
48
48
# Lemmatize negated verbs to their affirmative forms.
49
49
# 不是 bùshì = not be
50
- # 没有 méiyǒu = not exist
51
- # 沒能 méinéng = cannot
50
+ # 沒有 没有 méiyǒu = not exist
51
+ # 沒能 没能 méinéng = cannot
52
52
# 未能 wèinéng = cannot
53
+ # Lemmatize question verbs to their base forms.
54
+ # 要不要 yàobùyào = do (you) want?
55
+ # 有没有 yǒuméiyǒu = do (you) have?
53
56
# Verbs that are derived from the copula and tagged as the copula need
54
57
# to have the lemma of the copula (是 shì 爲 為 为 wèi/wéi).
55
- # 亦為 亦为 Yì wèi také
56
- # 則為 则为 Zé wèi potom
57
- # 更為 更为 Gèng wèi více
58
- # 認為 认为 Rènwéi myslet, věřit
59
- # 以為 以为 Yǐwéi myslet, věřit
60
- # 以爲 以为 Yǐwéi myslet, věřit
58
+ # 亦為 亦为 yìwèi = také
59
+ # 則為 则为 zéwèi = potom
60
+ # 更為 更为 gèngwèi = více
61
+ # 認為 认为 rènwéi = myslet, věřit
62
+ # 以為 以为 yǐwéi = myslet, věřit
63
+ # 以爲 以为 yǐwéi = myslet, věřit
61
64
if re .match (r'^(AUX|VERB)$' , node .upos ):
62
65
m1 = re .match (r'^([不没沒未])(.+)$' , node .form )
63
- m2 = re .search (r'([是爲為为])' , node .form )
66
+ m2 = re .match (r'^(.+)([不没沒未])\1$' , node .form )
67
+ m3 = re .search (r'([是爲為为])' , node .form )
64
68
if m1 :
65
69
node .lemma = m1 .group (2 )
66
70
node .feats ['Polarity' ] = 'Neg'
67
71
elif m2 :
68
72
node .lemma = m2 .group (1 )
73
+ node .feats ['Mood' ] = 'Int'
74
+ elif m3 :
75
+ node .lemma = m3 .group (1 )
69
76
if node .lemma == '爲' :
70
77
node .lemma = '為'
71
78
elif node .form in self .lemma :
0 commit comments