173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
|
return this.lexicographer.formatTags(sMorph);
}
setLabelsOnToken (oToken) {
if (!this.lexicographer) {
return;
}
if (!oToken.hasOwnProperty("lMorph")) {
oToken["lMorph"] = this.getMorph(oToken["sValue"]);
}
if (oToken["sType"].startsWith("WORD")) {
oToken["bValidToken"] = (oToken.hasOwnProperty("lMorph")) ? true : this.isValidToken(oToken["sValue"]);
let [sPrefix, sStem, sSuffix] = this.lexicographer.split(oToken["sValue"]);
if (sStem != oToken["sValue"]) {
oToken["lSubTokens"] = [
{ "sType": "WORD", "sValue": sPrefix, "lMorph": this.getMorph(sPrefix) },
{ "sType": "WORD", "sValue": sStem, "lMorph": this.getMorph(sStem) },
{ "sType": "WORD", "sValue": sSuffix, "lMorph": this.getMorph(sSuffix) }
];
|
>
>
>
<
|
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
|
return this.lexicographer.formatTags(sMorph);
}
setLabelsOnToken (oToken) {
if (!this.lexicographer) {
return;
}
if (oToken["sType"].startsWith("WORD")) {
oToken["bValidToken"] = (oToken.hasOwnProperty("lMorph")) ? true : this.isValidToken(oToken["sValue"]);
}
if (!oToken.hasOwnProperty("lMorph")) {
oToken["lMorph"] = this.getMorph(oToken["sValue"]);
}
if (oToken["sType"].startsWith("WORD")) {
let [sPrefix, sStem, sSuffix] = this.lexicographer.split(oToken["sValue"]);
if (sStem != oToken["sValue"]) {
oToken["lSubTokens"] = [
{ "sType": "WORD", "sValue": sPrefix, "lMorph": this.getMorph(sPrefix) },
{ "sType": "WORD", "sValue": sStem, "lMorph": this.getMorph(sStem) },
{ "sType": "WORD", "sValue": sSuffix, "lMorph": this.getMorph(sSuffix) }
];
|