131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
+
+
+
+
+
+
+
+
+
+
+
|
if not self.lexicographer:
return ""
return self.lexicographer.readableMorph(sMorph)
def setLabelsOnToken (self, dToken):
if not self.lexicographer:
return
if "lMorph" not in dToken:
dToken["lMorph"] = self.getMorph(dToken["sValue"])
if dToken["sType"] == "WORD":
dToken["bValidToken"] = self.isValidToken(dToken["sValue"])
sPrefix, sStem, sSuffix = self.lexicographer.split(dToken["sValue"])
if sStem != dToken["sValue"]:
dToken["lSubTokens"] = [
{ "sType": "WORD", "sValue": sPrefix, "lMorph": self.getMorph(sPrefix) },
{ "sType": "WORD", "sValue": sStem, "lMorph": self.getMorph(sStem) },
{ "sType": "WORD", "sValue": sSuffix, "lMorph": self.getMorph(sSuffix) }
]
self.lexicographer.setLabelsOnToken(dToken)
# Storage
def activateStorage (self):
"store all lemmas and morphologies retrieved from the word graph"
|