145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
|
if (!this.lexicographer) {
return [];
}
let lWordAndMorph = [];
for (let sElem of this.lexicographer.split(sWord)) {
if (sElem) {
let lMorph = this.getMorph(sElem);
let sLex = this.lexicographer.analyze(sElem)
let aRes = [];
if (sLex) {
aRes = [ [lMorph.join(" | "), sLex] ];
} else {
for (let sMorph of lMorph) {
aRes.push([sMorph, this.lexicographer.formatTags(sMorph)]);
}
}
if (aRes.length > 0) {
lWordAndMorph.push([sElem, aRes]);
}
}
}
return lWordAndMorph;
}
readableMorph (sMorph) {
if (!this.lexicographer) {
return [];
}
return this.lexicographer.formatTags(sMorph);
}
setLabelsOnToken (oToken) {
if (!this.lexicographer) {
return;
}
if (oToken["sType"].startsWith("WORD")) {
|
|
|
|
|
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
|
if (!this.lexicographer) {
return [];
}
let lWordAndMorph = [];
for (let sElem of this.lexicographer.split(sWord)) {
if (sElem) {
let lMorph = this.getMorph(sElem);
let sLex = this.lexicographer.analyze(sElem);
let aRes = [];
if (sLex) {
aRes = [ [lMorph.join(" | "), sLex] ];
} else {
for (let sMorph of lMorph) {
aRes.push([sMorph, this.lexicographer.readableMorph(sMorph)]);
}
}
if (aRes.length > 0) {
lWordAndMorph.push([sElem, aRes]);
}
}
}
return lWordAndMorph;
}
readableMorph (sMorph) {
if (!this.lexicographer) {
return [];
}
return this.lexicographer.readableMorph(sMorph);
}
setLabelsOnToken (oToken) {
if (!this.lexicographer) {
return;
}
if (oToken["sType"].startsWith("WORD")) {
|