Skip to content

Commit bfa1362

Browse files
committed
Added HTML tag for possessive stems, solves #117
1 parent 9af60d9 commit bfa1362

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

lib/convert/CW.js

+13
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ class Entry {
169169
syll,
170170
test,
171171
stems,
172+
fststems,
173+
possessive,
172174
rw_domains,
173175
rw_indices,
174176
wn_domains,
@@ -229,6 +231,17 @@ class Entry {
229231

230232
this.#extractNotes();
231233

234+
if (possessive){
235+
if (fststems.length > 1) {
236+
throw new Error("Multiple fst stems in CW source");
237+
}
238+
if (stems.length > 1) {
239+
throw new Error("Multiple stems in CW source");
240+
}
241+
const nonPossessive = (fststems.length > 0) ? fststems[0] : stems[0];
242+
const htmlInfo = `<table colspan=2><tr><td>Nonposs</td><td><strong>${nonPossessive}</strong></td></tr><tr><td>Poss</td><td><strong>${possessive}</strong></td></tr></table>`;
243+
this.htmlInfo = htmlInfo;
244+
}
232245
}
233246

234247
/**

lib/convert/dlx2importjson.js

+4
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ function convertEntry({
107107
wn_domains,
108108
};
109109

110+
if(dataSources.CW.htmlInfo) {
111+
linguistInfo.analysis = dataSources.CW.htmlInfo;
112+
}
113+
110114
// If an entry lacks senses, it's because the definition consists of nothing but notes.
111115
// In this case, populate a sense based on CW's original definition, without brackets.
112116
if (!senses.length) {

lib/utilities/readToolbox.js

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ export class ToolboxEntry {
4545
this.sources = this.getLinesByType(`src`);
4646
this.sro = this.getLineByType(`sro`);
4747
this.stems = this.getLinesByType(`stm`);
48+
this.fststems = this.getLinesByType(`fststem`);
49+
this.possessive = this.getLineByType(`poss`);
4850
this.syll = this.getLineByType(`syl`);
4951
this.rw_domains = this.getLinesByType(`rw`);
5052
this.rw_indices = this.getLinesByType(`rw2`);

0 commit comments

Comments
 (0)