You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| FEATS_String-- a sublist of features matches exactly
48
52
| DEPRELString-- deprel matches exactly
@@ -70,6 +74,8 @@ ifMatchUDPattern patt tree@(RTree node subtrees) = case patt of
70
74
FORM s -> matchString s (udFORM node)
71
75
LEMMA s -> matchString s (udLEMMA node)
72
76
POS s -> matchString s (udUPOS node)
77
+
XPOS s -> matchString s (udXPOS node)
78
+
MISC name s ->maybeFalse (matchString s) $ listToMaybe [ intercalate "," vals |UDData arg vals <- udMISC node , arg == name ]
73
79
FEATS udds -> udFEATS node == prs udds
74
80
FEATS_ udds ->
75
81
let uddlist = prs udds in
@@ -123,6 +129,8 @@ data UDReplacement =
123
129
REPLACE_FORMStringString
124
130
| REPLACE_LEMMAStringString
125
131
| REPLACE_POSStringString
132
+
| REPLACE_XPOSStringString
133
+
| REPLACE_MISCStringStringString
126
134
| REPLACE_DEPRELStringString
127
135
| REPLACE_DEPREL_StringString
128
136
| REPLACE_FEATSStringString
@@ -143,6 +151,8 @@ replaceWithUDPattern rep tree@(RTree node subtrs) = case rep of
143
151
REPLACE_FORM old new | ifMatchUDPattern (FORM old) tree -> true $ tree{root = node{udFORM = new}}
144
152
REPLACE_LEMMA old new | ifMatchUDPattern (LEMMA old) tree -> true $ tree{root = node{udLEMMA = new}}
145
153
REPLACE_POS old new | ifMatchUDPattern (POS old) tree -> true $ tree{root = node{udUPOS = new}}
154
+
REPLACE_XPOS old new | ifMatchUDPattern (XPOS old) tree -> true $ tree{root = node{udXPOS = new}}
155
+
REPLACE_MISC name old new | ifMatchUDPattern (MISC name old) tree -> true $ tree{root = node{udMISC =map (\ud ->if udArg ud == name then ud{udVals = getSeps ',' new} else ud) (udMISC node)}}
146
156
REPLACE_DEPREL old new | ifMatchUDPattern (DEPREL old) tree -> true $ tree{root = node{udDEPREL = new}}
147
157
REPLACE_DEPREL_ old new | ifMatchUDPattern (DEPREL_ old) tree -> true $ tree{root = node{udDEPREL = new}}
148
158
REPLACE_FEATS old new | ifMatchUDPattern (FEATS old) tree -> true $ tree{root = node{udFEATS = prs new}}
0 commit comments