word-aligner 1.0.1-alpha → 1.0.1-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/misc.xml +0 -1
- package/lib/js/utils/MorphUtils.js +1 -53
- package/lib/js/utils/morphCodeLocalizationMap.js +1 -92
- package/package.json +5 -5
- package/src/js/aligner.js +10 -10
- package/src/js/utils/MorphUtils.js +1 -57
- package/src/js/utils/morphCodeLocalizationMap.js +0 -91
- package/.idea/workspace.xml +0 -268
package/.idea/misc.xml
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.getMorphLocalizationKeysGreek = exports.getMorphLocalizationKeysHebrewAramaic = exports.getMorphLocalizationKeys = undefined;
|
|
7
7
|
|
|
8
8
|
var _getIterator2 = require('babel-runtime/core-js/get-iterator');
|
|
9
9
|
|
|
@@ -29,9 +29,6 @@ var getMorphLocalizationKeys = exports.getMorphLocalizationKeys = function getMo
|
|
|
29
29
|
|
|
30
30
|
case 'gr':
|
|
31
31
|
default:
|
|
32
|
-
if (morph && morph.length === 12) {
|
|
33
|
-
return getMorphLocalizationKeysGreekSR(morph);
|
|
34
|
-
}
|
|
35
32
|
return getMorphLocalizationKeysGreek(morph);
|
|
36
33
|
}
|
|
37
34
|
};
|
|
@@ -154,53 +151,4 @@ var getMorphLocalizationKeysGreek = exports.getMorphLocalizationKeysGreek = func
|
|
|
154
151
|
} // unknown code, prefixing with '*'
|
|
155
152
|
});
|
|
156
153
|
return morphKeys;
|
|
157
|
-
};
|
|
158
|
-
/**
|
|
159
|
-
* @description - Get a list of all the localization keys for a morph string in Greek
|
|
160
|
-
* @param {String} morph - the morph string, e.g. Gr,N,,,,,GMS,
|
|
161
|
-
* @return {Array} - List of localization keys (unknown codes are prefixed with `*`)
|
|
162
|
-
*/
|
|
163
|
-
var getMorphLocalizationKeysGreekSR = exports.getMorphLocalizationKeysGreekSR = function getMorphLocalizationKeysGreekSR(morph) {
|
|
164
|
-
if (!morph || typeof morph !== 'string' || !morph.trim().length) {
|
|
165
|
-
return [];
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
var morphKeys = [];
|
|
169
|
-
// Will parsed out the morph string to its 12 places, the 1st being language,
|
|
170
|
-
// 2nd always empty, 3rd role, 4th type, and so on
|
|
171
|
-
var regex = /([A-Z0-9,.][a-z]*)/g; // Delimited by boundry of a comma, period, or uppercase letter
|
|
172
|
-
var codes = morph.match(regex).map(function (code) {
|
|
173
|
-
return [',', '.'].includes(code) ? null : code;
|
|
174
|
-
});
|
|
175
|
-
if (codes.length < 3) {
|
|
176
|
-
return morph;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
var morpMapGrk = _morphCodeLocalizationMap.morphCodeLocalizationMapSrGrk;
|
|
180
|
-
if (morpMapGrk[2].hasOwnProperty(codes[2])) {
|
|
181
|
-
morphKeys.push(morpMapGrk[2][codes[2]].key);
|
|
182
|
-
} else {
|
|
183
|
-
morphKeys.push('*' + codes[2]); // no known localization key, so prefixing with '*'
|
|
184
|
-
}
|
|
185
|
-
if (codes[4]) {
|
|
186
|
-
var col2 = morpMapGrk[2];
|
|
187
|
-
var col2Form = col2[codes[2]];
|
|
188
|
-
if (col2.hasOwnProperty(codes[2]) && col2Form[4] && col2Form[4].hasOwnProperty(codes[4])) {
|
|
189
|
-
morphKeys.push(col2Form[4][codes[4]]);
|
|
190
|
-
} else {
|
|
191
|
-
morphKeys.push('*' + codes[4]);
|
|
192
|
-
} // unknown type, prefixing with '*'
|
|
193
|
-
}
|
|
194
|
-
codes.forEach(function (code, index) {
|
|
195
|
-
// 0 and 1 are ignored, already did 2 and 3 above
|
|
196
|
-
if (index < 5 || !code) {
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
if (morpMapGrk[index].hasOwnProperty(code)) {
|
|
200
|
-
morphKeys.push(morpMapGrk[index][code]);
|
|
201
|
-
} else {
|
|
202
|
-
morphKeys.push('*' + code);
|
|
203
|
-
} // unknown code, prefixing with '*'
|
|
204
|
-
});
|
|
205
|
-
return morphKeys;
|
|
206
154
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.morphCodeLocalizationMapGrk = exports.
|
|
6
|
+
exports.morphCodeLocalizationMapGrk = exports.morphCodeLocalizationMapAr = exports.morphCodeLocalizationMapHeb = undefined;
|
|
7
7
|
|
|
8
8
|
var _lodash = require('lodash');
|
|
9
9
|
|
|
@@ -190,97 +190,6 @@ morphCodeLocalizationMapAr.verb_stems = {
|
|
|
190
190
|
G: 'ittaphal'
|
|
191
191
|
};
|
|
192
192
|
|
|
193
|
-
// These reflect the columns on for the SR on pages 9 and 10 of: https://greekcntr.org/resources/NTGRG.pdf
|
|
194
|
-
var formVI = { // Form for VI
|
|
195
|
-
I: 'indicative',
|
|
196
|
-
M: 'imperative',
|
|
197
|
-
S: 'subjunctive',
|
|
198
|
-
O: 'optative',
|
|
199
|
-
N: 'infinitive',
|
|
200
|
-
P: 'participle'
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
var formNADX = { // Form for NADX
|
|
204
|
-
C: 'comparative',
|
|
205
|
-
S: 'superlatives',
|
|
206
|
-
D: 'diminutive',
|
|
207
|
-
I: 'indeclinable'
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
var morphCodeLocalizationMapSrGrk = exports.morphCodeLocalizationMapSrGrk = {
|
|
211
|
-
2: { // Function
|
|
212
|
-
N: {
|
|
213
|
-
key: 'noun',
|
|
214
|
-
4: formNADX
|
|
215
|
-
},
|
|
216
|
-
R: {
|
|
217
|
-
key: 'pronoun'
|
|
218
|
-
},
|
|
219
|
-
A: {
|
|
220
|
-
key: 'adjective',
|
|
221
|
-
4: formNADX
|
|
222
|
-
},
|
|
223
|
-
V: {
|
|
224
|
-
key: 'verb',
|
|
225
|
-
4: formVI
|
|
226
|
-
},
|
|
227
|
-
D: {
|
|
228
|
-
key: 'adverb',
|
|
229
|
-
4: formNADX
|
|
230
|
-
},
|
|
231
|
-
P: {
|
|
232
|
-
key: 'preposition'
|
|
233
|
-
},
|
|
234
|
-
C: {
|
|
235
|
-
key: 'conjunction'
|
|
236
|
-
},
|
|
237
|
-
I: {
|
|
238
|
-
key: 'interjection',
|
|
239
|
-
4: formVI
|
|
240
|
-
},
|
|
241
|
-
X: {
|
|
242
|
-
key: 'determiner', // new
|
|
243
|
-
4: formNADX
|
|
244
|
-
}
|
|
245
|
-
},
|
|
246
|
-
5: { // Tense
|
|
247
|
-
P: 'present',
|
|
248
|
-
I: 'imperfect',
|
|
249
|
-
F: 'future',
|
|
250
|
-
A: 'aorist',
|
|
251
|
-
E: 'perfect',
|
|
252
|
-
L: 'pluperfect'
|
|
253
|
-
},
|
|
254
|
-
6: { // Voice
|
|
255
|
-
A: 'active',
|
|
256
|
-
M: 'middle',
|
|
257
|
-
P: 'passive'
|
|
258
|
-
},
|
|
259
|
-
7: { // Person
|
|
260
|
-
1: 'first',
|
|
261
|
-
2: 'second',
|
|
262
|
-
3: 'third'
|
|
263
|
-
},
|
|
264
|
-
8: { // Case
|
|
265
|
-
N: 'nominative',
|
|
266
|
-
G: 'genitive',
|
|
267
|
-
D: 'dative',
|
|
268
|
-
A: 'accusative',
|
|
269
|
-
V: 'vocative'
|
|
270
|
-
},
|
|
271
|
-
9: { // Gender
|
|
272
|
-
M: 'masculine',
|
|
273
|
-
F: 'feminine',
|
|
274
|
-
N: 'neuter',
|
|
275
|
-
A: 'any' // new
|
|
276
|
-
},
|
|
277
|
-
10: { // Number
|
|
278
|
-
S: 'singular',
|
|
279
|
-
P: 'plural',
|
|
280
|
-
A: 'any' // new
|
|
281
|
-
}
|
|
282
|
-
};
|
|
283
|
-
|
|
284
193
|
// These reflect the columns on page 55 of https://greekcntr.org/downloads/project.pdf
|
|
285
194
|
// This helps us translate codes starting and the 3rd place (the 2nd index) of a morph string
|
|
286
195
|
// The numbered keys are the index of that code in the string, where the letter index is the code
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "word-aligner",
|
|
3
|
-
"version": "1.0.1-
|
|
3
|
+
"version": "1.0.1-beta",
|
|
4
4
|
"description": "A library for handling word alignment",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -51,18 +51,18 @@
|
|
|
51
51
|
"eslint": "^5.12.1",
|
|
52
52
|
"eslint-config-google": "^0.12.0",
|
|
53
53
|
"eslint-plugin-jest": "^22.1.3",
|
|
54
|
+
"fs-extra": "6.0.1",
|
|
54
55
|
"json-stringify-safe": "5.0.1",
|
|
55
56
|
"jest": "^23.6.0",
|
|
56
57
|
"ospath": "1.2.2",
|
|
58
|
+
"path": "0.12.7",
|
|
59
|
+
"path-extra": "^4.2.1",
|
|
60
|
+
"rimraf": "^2.6.2",
|
|
57
61
|
"usfm-js": "2.1.0"
|
|
58
62
|
},
|
|
59
63
|
"dependencies": {
|
|
60
64
|
"babel-runtime": "^6.26.0",
|
|
61
|
-
"fs-extra": "6.0.1",
|
|
62
65
|
"lodash": "^4.17.11",
|
|
63
|
-
"path": "0.12.7",
|
|
64
|
-
"path-extra": "^4.2.1",
|
|
65
|
-
"rimraf": "^2.6.2",
|
|
66
66
|
"string-punctuation-tokenizer": "2.0.0",
|
|
67
67
|
"transform-runtime": "0.0.0"
|
|
68
68
|
}
|
package/src/js/aligner.js
CHANGED
|
@@ -29,14 +29,14 @@ export const hasAlignments = (alignments) => {
|
|
|
29
29
|
* @return {Array} - sorted array of verseObjects to be used for verseText of targetLanguage
|
|
30
30
|
*/
|
|
31
31
|
export const merge = (alignments, wordBank, verseString,
|
|
32
|
-
|
|
32
|
+
useVerseText = false) => {
|
|
33
33
|
// get the definitive list of verseObjects from the verse, unaligned but in order
|
|
34
34
|
const {newVerseObjects: unalignedOrdered, wordMap} =
|
|
35
35
|
VerseObjectUtils.getOrderedVerseObjectsFromString(verseString);
|
|
36
36
|
// assign verseObjects with unaligned objects to be replaced with aligned ones
|
|
37
37
|
// check each word in the verse string is also in the word bank or alignments
|
|
38
38
|
const verseObjectsNotInAlignmentData = verseStringWordsContainedInAlignments(
|
|
39
|
-
|
|
39
|
+
alignments, wordBank, wordMap);
|
|
40
40
|
if (verseObjectsNotInAlignmentData.length > 0) {
|
|
41
41
|
if (hasAlignments(alignments)) { // if verse has some alignments
|
|
42
42
|
const verseWordsJoined = verseObjectsNotInAlignmentData.map(({text}) => text).join(', ');
|
|
@@ -53,9 +53,9 @@ export const merge = (alignments, wordBank, verseString,
|
|
|
53
53
|
for (let i = 0; i < wbLen; i++) {
|
|
54
54
|
const bottomWord = wordBank[i];
|
|
55
55
|
const verseObject = VerseObjectUtils.wordVerseObjectFromBottomWord(
|
|
56
|
-
|
|
56
|
+
bottomWord);
|
|
57
57
|
const index = VerseObjectUtils.indexOfVerseObject(
|
|
58
|
-
|
|
58
|
+
wordMap, verseObject);
|
|
59
59
|
if (index > -1) {
|
|
60
60
|
const location = wordMap[index];
|
|
61
61
|
location.array[location.pos] = verseObject;
|
|
@@ -132,7 +132,7 @@ export const merge = (alignments, wordBank, verseString,
|
|
|
132
132
|
* the given alignments
|
|
133
133
|
*/
|
|
134
134
|
export function verseStringWordsContainedInAlignments(
|
|
135
|
-
|
|
135
|
+
alignments, wordBank, wordMap) {
|
|
136
136
|
const unalignedMap = wordMap.filter((wordItem) => {
|
|
137
137
|
const verseObject = wordItem.array[wordItem.pos];
|
|
138
138
|
const checkIfWordMatches = function(verseObject) {
|
|
@@ -251,7 +251,7 @@ export const orderAlignments = function(alignmentVerse, alignmentUnOrdered) {
|
|
|
251
251
|
let orderedObjects = null;
|
|
252
252
|
if (typeof alignmentVerse === 'string') {
|
|
253
253
|
orderedObjects = VerseObjectUtils.getOrderedVerseObjectsFromString(
|
|
254
|
-
|
|
254
|
+
alignmentVerse);
|
|
255
255
|
} else {
|
|
256
256
|
orderedObjects = VerseObjectUtils.getOrderedVerseObjects(alignmentVerse);
|
|
257
257
|
}
|
|
@@ -288,7 +288,7 @@ export const orderAlignments = function(alignmentVerse, alignmentUnOrdered) {
|
|
|
288
288
|
}
|
|
289
289
|
if (index < 0) { // if still not found in topWords, it's an unaligned topWord
|
|
290
290
|
const wordObject = VerseObjectUtils.alignmentObjectFromVerseObject(
|
|
291
|
-
|
|
291
|
+
nextWord);
|
|
292
292
|
alignment.push({topWords: [wordObject], bottomWords: []});
|
|
293
293
|
}
|
|
294
294
|
}
|
|
@@ -309,7 +309,7 @@ export const orderAlignments = function(alignmentVerse, alignmentUnOrdered) {
|
|
|
309
309
|
export const addVerseObjectToAlignment = (verseObject, alignment) => {
|
|
310
310
|
if (verseObject.type === 'milestone' && verseObject.children.length > 0) {
|
|
311
311
|
const wordObject = VerseObjectUtils.alignmentObjectFromVerseObject(
|
|
312
|
-
|
|
312
|
+
verseObject);
|
|
313
313
|
const duplicate = alignment.topWords.find(function(obj) {
|
|
314
314
|
return (obj.word === wordObject.word) &&
|
|
315
315
|
(obj.occurrence === wordObject.occurrence);
|
|
@@ -322,7 +322,7 @@ export const addVerseObjectToAlignment = (verseObject, alignment) => {
|
|
|
322
322
|
});
|
|
323
323
|
} else if (verseObject.type === 'word' && !verseObject.children) {
|
|
324
324
|
const wordObject = VerseObjectUtils.alignmentObjectFromVerseObject(
|
|
325
|
-
|
|
325
|
+
verseObject);
|
|
326
326
|
alignment.bottomWords.push(wordObject);
|
|
327
327
|
}
|
|
328
328
|
};
|
|
@@ -457,7 +457,7 @@ export const generateWordBank = (verseData) => {
|
|
|
457
457
|
* @return {{alignments, wordBank}} - Reset alignments data
|
|
458
458
|
*/
|
|
459
459
|
export const getBlankAlignmentDataForVerse = (
|
|
460
|
-
|
|
460
|
+
ugntVerse, targetLanguageVerse) => {
|
|
461
461
|
const alignments = generateBlankAlignments(ugntVerse);
|
|
462
462
|
const wordBank = generateWordBank(targetLanguageVerse);
|
|
463
463
|
return {alignments, wordBank};
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-use-before-define */
|
|
2
|
-
import {
|
|
3
|
-
morphCodeLocalizationMapGrk,
|
|
4
|
-
morphCodeLocalizationMapAr,
|
|
5
|
-
morphCodeLocalizationMapHeb,
|
|
6
|
-
morphCodeLocalizationMapSrGrk
|
|
7
|
-
} from './morphCodeLocalizationMap';
|
|
2
|
+
import {morphCodeLocalizationMapGrk, morphCodeLocalizationMapAr, morphCodeLocalizationMapHeb} from './morphCodeLocalizationMap';
|
|
8
3
|
|
|
9
4
|
/**
|
|
10
5
|
* @description - Get a list of all the localization keys for a morph string in Greek
|
|
@@ -22,9 +17,6 @@ export const getMorphLocalizationKeys = (morph) => {
|
|
|
22
17
|
|
|
23
18
|
case 'gr':
|
|
24
19
|
default:
|
|
25
|
-
if (morph && morph.length === 12) {
|
|
26
|
-
return getMorphLocalizationKeysGreekSR(morph);
|
|
27
|
-
}
|
|
28
20
|
return getMorphLocalizationKeysGreek(morph);
|
|
29
21
|
}
|
|
30
22
|
};
|
|
@@ -123,51 +115,3 @@ export const getMorphLocalizationKeysGreek = (morph) => {
|
|
|
123
115
|
});
|
|
124
116
|
return morphKeys;
|
|
125
117
|
};
|
|
126
|
-
/**
|
|
127
|
-
* @description - Get a list of all the localization keys for a morph string in Greek
|
|
128
|
-
* @param {String} morph - the morph string, e.g. Gr,N,,,,,GMS,
|
|
129
|
-
* @return {Array} - List of localization keys (unknown codes are prefixed with `*`)
|
|
130
|
-
*/
|
|
131
|
-
export const getMorphLocalizationKeysGreekSR = (morph) => {
|
|
132
|
-
if (!morph || typeof morph !== 'string' || !morph.trim().length) {
|
|
133
|
-
return [];
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const morphKeys = [];
|
|
137
|
-
// Will parsed out the morph string to its 12 places, the 1st being language,
|
|
138
|
-
// 2nd always empty, 3rd role, 4th type, and so on
|
|
139
|
-
const regex = /([A-Z0-9,.][a-z]*)/g; // Delimited by boundry of a comma, period, or uppercase letter
|
|
140
|
-
const codes = morph.match(regex).map((code) => [',', '.'].includes(code) ? null : code);
|
|
141
|
-
if (codes.length < 3) {
|
|
142
|
-
return morph;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
const morpMapGrk = morphCodeLocalizationMapSrGrk;
|
|
146
|
-
if (morpMapGrk[2].hasOwnProperty(codes[2])) {
|
|
147
|
-
morphKeys.push(morpMapGrk[2][codes[2]].key);
|
|
148
|
-
} else {
|
|
149
|
-
morphKeys.push('*' + codes[2]); // no known localization key, so prefixing with '*'
|
|
150
|
-
}
|
|
151
|
-
if (codes[4]) {
|
|
152
|
-
const col2 = morpMapGrk[2];
|
|
153
|
-
const col2Form = col2[codes[2]];
|
|
154
|
-
if (col2.hasOwnProperty(codes[2]) && col2Form[4] && col2Form[4].hasOwnProperty(codes[4])) {
|
|
155
|
-
morphKeys.push(col2Form[4][codes[4]]);
|
|
156
|
-
} else {
|
|
157
|
-
morphKeys.push('*' + codes[4]);
|
|
158
|
-
} // unknown type, prefixing with '*'
|
|
159
|
-
}
|
|
160
|
-
codes.forEach((code, index) => {
|
|
161
|
-
// 0 and 1 are ignored, already did 2 and 3 above
|
|
162
|
-
if (index < 5 || !code) {
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
if (morpMapGrk[index].hasOwnProperty(code)) {
|
|
166
|
-
morphKeys.push(morpMapGrk[index][code]);
|
|
167
|
-
} else {
|
|
168
|
-
morphKeys.push('*' + code);
|
|
169
|
-
} // unknown code, prefixing with '*'
|
|
170
|
-
});
|
|
171
|
-
return morphKeys;
|
|
172
|
-
};
|
|
173
|
-
|
|
@@ -183,97 +183,6 @@ morphCodeLocalizationMapAr.verb_stems = {
|
|
|
183
183
|
G: 'ittaphal',
|
|
184
184
|
};
|
|
185
185
|
|
|
186
|
-
// These reflect the columns on for the SR on pages 9 and 10 of: https://greekcntr.org/resources/NTGRG.pdf
|
|
187
|
-
const formVI = { // Form for VI
|
|
188
|
-
I: 'indicative',
|
|
189
|
-
M: 'imperative',
|
|
190
|
-
S: 'subjunctive',
|
|
191
|
-
O: 'optative',
|
|
192
|
-
N: 'infinitive',
|
|
193
|
-
P: 'participle',
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
const formNADX = { // Form for NADX
|
|
197
|
-
C: 'comparative',
|
|
198
|
-
S: 'superlatives',
|
|
199
|
-
D: 'diminutive',
|
|
200
|
-
I: 'indeclinable',
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
export const morphCodeLocalizationMapSrGrk = {
|
|
204
|
-
2: { // Function
|
|
205
|
-
N: {
|
|
206
|
-
key: 'noun',
|
|
207
|
-
4: formNADX,
|
|
208
|
-
},
|
|
209
|
-
R: {
|
|
210
|
-
key: 'pronoun',
|
|
211
|
-
},
|
|
212
|
-
A: {
|
|
213
|
-
key: 'adjective',
|
|
214
|
-
4: formNADX,
|
|
215
|
-
},
|
|
216
|
-
V: {
|
|
217
|
-
key: 'verb',
|
|
218
|
-
4: formVI,
|
|
219
|
-
},
|
|
220
|
-
D: {
|
|
221
|
-
key: 'adverb',
|
|
222
|
-
4: formNADX,
|
|
223
|
-
},
|
|
224
|
-
P: {
|
|
225
|
-
key: 'preposition',
|
|
226
|
-
},
|
|
227
|
-
C: {
|
|
228
|
-
key: 'conjunction',
|
|
229
|
-
},
|
|
230
|
-
I: {
|
|
231
|
-
key: 'interjection',
|
|
232
|
-
4: formVI,
|
|
233
|
-
},
|
|
234
|
-
X: {
|
|
235
|
-
key: 'determiner', // new
|
|
236
|
-
4: formNADX,
|
|
237
|
-
},
|
|
238
|
-
},
|
|
239
|
-
5: { // Tense
|
|
240
|
-
P: 'present',
|
|
241
|
-
I: 'imperfect',
|
|
242
|
-
F: 'future',
|
|
243
|
-
A: 'aorist',
|
|
244
|
-
E: 'perfect',
|
|
245
|
-
L: 'pluperfect',
|
|
246
|
-
},
|
|
247
|
-
6: { // Voice
|
|
248
|
-
A: 'active',
|
|
249
|
-
M: 'middle',
|
|
250
|
-
P: 'passive',
|
|
251
|
-
},
|
|
252
|
-
7: { // Person
|
|
253
|
-
1: 'first',
|
|
254
|
-
2: 'second',
|
|
255
|
-
3: 'third',
|
|
256
|
-
},
|
|
257
|
-
8: { // Case
|
|
258
|
-
N: 'nominative',
|
|
259
|
-
G: 'genitive',
|
|
260
|
-
D: 'dative',
|
|
261
|
-
A: 'accusative',
|
|
262
|
-
V: 'vocative',
|
|
263
|
-
},
|
|
264
|
-
9: { // Gender
|
|
265
|
-
M: 'masculine',
|
|
266
|
-
F: 'feminine',
|
|
267
|
-
N: 'neuter',
|
|
268
|
-
A: 'any', // new
|
|
269
|
-
},
|
|
270
|
-
10: { // Number
|
|
271
|
-
S: 'singular',
|
|
272
|
-
P: 'plural',
|
|
273
|
-
A: 'any', // new
|
|
274
|
-
},
|
|
275
|
-
};
|
|
276
|
-
|
|
277
186
|
// These reflect the columns on page 55 of https://greekcntr.org/downloads/project.pdf
|
|
278
187
|
// This helps us translate codes starting and the 3rd place (the 2nd index) of a morph string
|
|
279
188
|
// The numbered keys are the index of that code in the string, where the letter index is the code
|
package/.idea/workspace.xml
DELETED
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="AutoImportSettings">
|
|
4
|
-
<option name="autoReloadType" value="ALL" />
|
|
5
|
-
</component>
|
|
6
|
-
<component name="ChangeListManager">
|
|
7
|
-
<list default="true" id="0557423a-f59a-40db-af07-9e6f26fd3bd6" name="Default Changelist" comment="">
|
|
8
|
-
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
|
|
9
|
-
</list>
|
|
10
|
-
<option name="SHOW_DIALOG" value="false" />
|
|
11
|
-
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
12
|
-
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
13
|
-
<option name="LAST_RESOLUTION" value="IGNORE" />
|
|
14
|
-
</component>
|
|
15
|
-
<component name="ComposerSettings">
|
|
16
|
-
<execution />
|
|
17
|
-
</component>
|
|
18
|
-
<component name="Git.Settings">
|
|
19
|
-
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
|
20
|
-
<map>
|
|
21
|
-
<entry key="$PROJECT_DIR$" value="testing-SR-ugnt" />
|
|
22
|
-
</map>
|
|
23
|
-
</option>
|
|
24
|
-
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
|
25
|
-
</component>
|
|
26
|
-
<component name="GithubProjectSettings">
|
|
27
|
-
<option name="branchProtectionPatterns">
|
|
28
|
-
<list>
|
|
29
|
-
<option value="develop" />
|
|
30
|
-
<option value="master" />
|
|
31
|
-
</list>
|
|
32
|
-
</option>
|
|
33
|
-
</component>
|
|
34
|
-
<component name="MarkdownSettingsMigration">
|
|
35
|
-
<option name="stateVersion" value="1" />
|
|
36
|
-
</component>
|
|
37
|
-
<component name="ProjectId" id="1lYS6RA6wMLDN0hx29OTPOVl0gg" />
|
|
38
|
-
<component name="ProjectViewState">
|
|
39
|
-
<option name="showLibraryContents" value="true" />
|
|
40
|
-
<option name="showMembers" value="true" />
|
|
41
|
-
</component>
|
|
42
|
-
<component name="PropertiesComponent"><![CDATA[{
|
|
43
|
-
"keyToString": {
|
|
44
|
-
"Git.Branch.Popup.ShowAllRemotes": "true",
|
|
45
|
-
"WebServerToolWindowFactoryState": "false",
|
|
46
|
-
"last_opened_file_path": "/Users/blm/Development/Electron/word-aligner",
|
|
47
|
-
"node.js.detected.package.eslint": "true",
|
|
48
|
-
"node.js.selected.package.eslint": "(autodetect)",
|
|
49
|
-
"nodejs.jest.jest_package": "/Users/blm/Development/Electron/word-aligner/node_modules/jest",
|
|
50
|
-
"nodejs_package_manager_path": "npm"
|
|
51
|
-
}
|
|
52
|
-
}]]></component>
|
|
53
|
-
<component name="PyCoverageOptionsProvider">
|
|
54
|
-
<option name="myUseBundledCoveragePy" value="true" />
|
|
55
|
-
</component>
|
|
56
|
-
<component name="RunManager" selected="Jest.MorphUtils tests.Greek">
|
|
57
|
-
<configuration default="true" type="Applet" factoryName="Applet">
|
|
58
|
-
<option name="WIDTH" value="400" />
|
|
59
|
-
<option name="HEIGHT" value="300" />
|
|
60
|
-
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
|
|
61
|
-
<module />
|
|
62
|
-
<method />
|
|
63
|
-
</configuration>
|
|
64
|
-
<configuration default="true" type="Application" factoryName="Application">
|
|
65
|
-
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
|
66
|
-
<method v="2">
|
|
67
|
-
<option name="Make" enabled="true" />
|
|
68
|
-
</method>
|
|
69
|
-
</configuration>
|
|
70
|
-
<configuration default="true" type="JUnit" factoryName="JUnit">
|
|
71
|
-
<option name="TEST_OBJECT" value="class" />
|
|
72
|
-
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
|
|
73
|
-
<method v="2">
|
|
74
|
-
<option name="Make" enabled="true" />
|
|
75
|
-
</method>
|
|
76
|
-
</configuration>
|
|
77
|
-
<configuration name="MorphUtils tests.Greek" type="JavaScriptTestRunnerJest" temporary="true" nameIsGenerated="true">
|
|
78
|
-
<node-interpreter value="project" />
|
|
79
|
-
<node-options value="" />
|
|
80
|
-
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
|
|
81
|
-
<working-dir value="$PROJECT_DIR$" />
|
|
82
|
-
<envs />
|
|
83
|
-
<scope-kind value="SUITE" />
|
|
84
|
-
<test-file value="$PROJECT_DIR$/__tests__/MorphUtils.test.js" />
|
|
85
|
-
<test-names>
|
|
86
|
-
<test-name value="MorphUtils tests" />
|
|
87
|
-
<test-name value="Greek" />
|
|
88
|
-
</test-names>
|
|
89
|
-
<method v="2" />
|
|
90
|
-
</configuration>
|
|
91
|
-
<configuration name="MorphUtils tests.Greek.Test MorphUtils.getMorphLocalizationKeys() - test ἐπιδιορθώσῃ" type="JavaScriptTestRunnerJest" temporary="true" nameIsGenerated="true">
|
|
92
|
-
<node-interpreter value="project" />
|
|
93
|
-
<node-options value="" />
|
|
94
|
-
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
|
|
95
|
-
<working-dir value="$PROJECT_DIR$" />
|
|
96
|
-
<envs />
|
|
97
|
-
<scope-kind value="TEST" />
|
|
98
|
-
<test-file value="$PROJECT_DIR$/__tests__/MorphUtils.test.js" />
|
|
99
|
-
<test-names>
|
|
100
|
-
<test-name value="MorphUtils tests" />
|
|
101
|
-
<test-name value="Greek" />
|
|
102
|
-
<test-name value="Test MorphUtils.getMorphLocalizationKeys() - test ἐπιδιορθώσῃ" />
|
|
103
|
-
</test-names>
|
|
104
|
-
<method v="2" />
|
|
105
|
-
</configuration>
|
|
106
|
-
<configuration name="MorphUtils tests.Greek.Test MorphUtils.getMorphLocalizationKeys() - test SR paul" type="JavaScriptTestRunnerJest" temporary="true" nameIsGenerated="true">
|
|
107
|
-
<node-interpreter value="project" />
|
|
108
|
-
<node-options value="" />
|
|
109
|
-
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
|
|
110
|
-
<working-dir value="$PROJECT_DIR$" />
|
|
111
|
-
<envs />
|
|
112
|
-
<scope-kind value="TEST" />
|
|
113
|
-
<test-file value="$PROJECT_DIR$/__tests__/MorphUtils.test.js" />
|
|
114
|
-
<test-names>
|
|
115
|
-
<test-name value="MorphUtils tests" />
|
|
116
|
-
<test-name value="Greek" />
|
|
117
|
-
<test-name value="Test MorphUtils.getMorphLocalizationKeys() - test SR paul" />
|
|
118
|
-
</test-names>
|
|
119
|
-
<method v="2" />
|
|
120
|
-
</configuration>
|
|
121
|
-
<configuration name="MorphUtils tests.Greek.Test MorphUtils.getMorphLocalizationKeys() - test paul" type="JavaScriptTestRunnerJest" temporary="true" nameIsGenerated="true">
|
|
122
|
-
<node-interpreter value="project" />
|
|
123
|
-
<node-options value="" />
|
|
124
|
-
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
|
|
125
|
-
<working-dir value="$PROJECT_DIR$" />
|
|
126
|
-
<envs />
|
|
127
|
-
<scope-kind value="TEST" />
|
|
128
|
-
<test-file value="$PROJECT_DIR$/__tests__/MorphUtils.test.js" />
|
|
129
|
-
<test-names>
|
|
130
|
-
<test-name value="MorphUtils tests" />
|
|
131
|
-
<test-name value="Greek" />
|
|
132
|
-
<test-name value="Test MorphUtils.getMorphLocalizationKeys() - test paul" />
|
|
133
|
-
</test-names>
|
|
134
|
-
<method v="2" />
|
|
135
|
-
</configuration>
|
|
136
|
-
<configuration name="MorphUtils tests.Greek.Test MorphUtils.getMorphLocalizationKeys() - test ἐκλεκτῶν" type="JavaScriptTestRunnerJest" temporary="true" nameIsGenerated="true">
|
|
137
|
-
<node-interpreter value="project" />
|
|
138
|
-
<node-options value="" />
|
|
139
|
-
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
|
|
140
|
-
<working-dir value="$PROJECT_DIR$" />
|
|
141
|
-
<envs />
|
|
142
|
-
<scope-kind value="TEST" />
|
|
143
|
-
<test-file value="$PROJECT_DIR$/__tests__/MorphUtils.test.js" />
|
|
144
|
-
<test-names>
|
|
145
|
-
<test-name value="MorphUtils tests" />
|
|
146
|
-
<test-name value="Greek" />
|
|
147
|
-
<test-name value="Test MorphUtils.getMorphLocalizationKeys() - test ἐκλεκτῶν" />
|
|
148
|
-
</test-names>
|
|
149
|
-
<method v="2" />
|
|
150
|
-
</configuration>
|
|
151
|
-
<configuration default="true" type="TestNG">
|
|
152
|
-
<option name="TEST_OBJECT" value="CLASS" />
|
|
153
|
-
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
|
|
154
|
-
<properties />
|
|
155
|
-
<listeners />
|
|
156
|
-
<method v="2">
|
|
157
|
-
<option name="Make" enabled="true" />
|
|
158
|
-
</method>
|
|
159
|
-
</configuration>
|
|
160
|
-
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType">
|
|
161
|
-
<module name="" />
|
|
162
|
-
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
|
|
163
|
-
<option name="PROGRAM_PARAMETERS" />
|
|
164
|
-
<predefined_log_file enabled="true" id="idea.log" />
|
|
165
|
-
<method v="2">
|
|
166
|
-
<option name="Make" enabled="true" />
|
|
167
|
-
</method>
|
|
168
|
-
</configuration>
|
|
169
|
-
<recent_temporary>
|
|
170
|
-
<list>
|
|
171
|
-
<item itemvalue="Jest.MorphUtils tests.Greek" />
|
|
172
|
-
<item itemvalue="Jest.MorphUtils tests.Greek.Test MorphUtils.getMorphLocalizationKeys() - test ἐπιδιορθώσῃ" />
|
|
173
|
-
<item itemvalue="Jest.MorphUtils tests.Greek.Test MorphUtils.getMorphLocalizationKeys() - test ἐκλεκτῶν" />
|
|
174
|
-
<item itemvalue="Jest.MorphUtils tests.Greek.Test MorphUtils.getMorphLocalizationKeys() - test SR paul" />
|
|
175
|
-
<item itemvalue="Jest.MorphUtils tests.Greek.Test MorphUtils.getMorphLocalizationKeys() - test paul" />
|
|
176
|
-
</list>
|
|
177
|
-
</recent_temporary>
|
|
178
|
-
</component>
|
|
179
|
-
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
|
180
|
-
<component name="TaskManager">
|
|
181
|
-
<task active="true" id="Default" summary="Default task">
|
|
182
|
-
<changelist id="0557423a-f59a-40db-af07-9e6f26fd3bd6" name="Default Changelist" comment="" />
|
|
183
|
-
<created>1607772356243</created>
|
|
184
|
-
<option name="number" value="Default" />
|
|
185
|
-
<option name="presentableId" value="Default" />
|
|
186
|
-
<updated>1607772356243</updated>
|
|
187
|
-
<workItem from="1607772357632" duration="829000" />
|
|
188
|
-
<workItem from="1607818082198" duration="1689000" />
|
|
189
|
-
<workItem from="1607853465330" duration="2024000" />
|
|
190
|
-
<workItem from="1607894197915" duration="602000" />
|
|
191
|
-
<workItem from="1634297398636" duration="1368000" />
|
|
192
|
-
<workItem from="1634548519554" duration="1242000" />
|
|
193
|
-
<workItem from="1669227932079" duration="750000" />
|
|
194
|
-
<workItem from="1669842210403" duration="588000" />
|
|
195
|
-
<workItem from="1669851149700" duration="587000" />
|
|
196
|
-
<workItem from="1669904980177" duration="2458000" />
|
|
197
|
-
<workItem from="1669944724896" duration="599000" />
|
|
198
|
-
<workItem from="1670113884923" duration="599000" />
|
|
199
|
-
<workItem from="1670186707404" duration="587000" />
|
|
200
|
-
<workItem from="1672950758072" duration="10654000" />
|
|
201
|
-
</task>
|
|
202
|
-
<task id="LOCAL-00001" summary="Added support for new SR morph format">
|
|
203
|
-
<created>1672962554084</created>
|
|
204
|
-
<option name="number" value="00001" />
|
|
205
|
-
<option name="presentableId" value="LOCAL-00001" />
|
|
206
|
-
<option name="project" value="LOCAL" />
|
|
207
|
-
<updated>1672962554084</updated>
|
|
208
|
-
</task>
|
|
209
|
-
<task id="LOCAL-00002" summary="Added support for new SR morph format">
|
|
210
|
-
<created>1672963360800</created>
|
|
211
|
-
<option name="number" value="00002" />
|
|
212
|
-
<option name="presentableId" value="LOCAL-00002" />
|
|
213
|
-
<option name="project" value="LOCAL" />
|
|
214
|
-
<updated>1672963360800</updated>
|
|
215
|
-
</task>
|
|
216
|
-
<option name="localTasksCounter" value="3" />
|
|
217
|
-
<servers />
|
|
218
|
-
</component>
|
|
219
|
-
<component name="TypeScriptGeneratedFilesManager">
|
|
220
|
-
<option name="version" value="3" />
|
|
221
|
-
</component>
|
|
222
|
-
<component name="VcsManagerConfiguration">
|
|
223
|
-
<MESSAGE value="Added support for new SR morph format" />
|
|
224
|
-
<option name="LAST_COMMIT_MESSAGE" value="Added support for new SR morph format" />
|
|
225
|
-
</component>
|
|
226
|
-
<component name="XDebuggerManager">
|
|
227
|
-
<breakpoint-manager>
|
|
228
|
-
<breakpoints>
|
|
229
|
-
<line-breakpoint enabled="true" type="javascript">
|
|
230
|
-
<url>file://$PROJECT_DIR$/src/js/utils/MorphUtils.js</url>
|
|
231
|
-
<line>138</line>
|
|
232
|
-
<properties lambdaOrdinal="-1" />
|
|
233
|
-
<option name="timeStamp" value="2" />
|
|
234
|
-
</line-breakpoint>
|
|
235
|
-
<line-breakpoint enabled="true" type="javascript">
|
|
236
|
-
<url>file://$PROJECT_DIR$/src/js/utils/MorphUtils.js</url>
|
|
237
|
-
<line>164</line>
|
|
238
|
-
<properties lambdaOrdinal="-1" />
|
|
239
|
-
<option name="timeStamp" value="8" />
|
|
240
|
-
</line-breakpoint>
|
|
241
|
-
<line-breakpoint enabled="true" type="javascript">
|
|
242
|
-
<url>file://$PROJECT_DIR$/src/js/utils/MorphUtils.js</url>
|
|
243
|
-
<line>170</line>
|
|
244
|
-
<properties lambdaOrdinal="-1" />
|
|
245
|
-
<option name="timeStamp" value="9" />
|
|
246
|
-
</line-breakpoint>
|
|
247
|
-
<line-breakpoint enabled="true" type="javascript">
|
|
248
|
-
<url>file://$PROJECT_DIR$/__tests__/MorphUtils.test.js</url>
|
|
249
|
-
<line>89</line>
|
|
250
|
-
<properties lambdaOrdinal="-1" />
|
|
251
|
-
<option name="timeStamp" value="12" />
|
|
252
|
-
</line-breakpoint>
|
|
253
|
-
<line-breakpoint enabled="true" type="javascript">
|
|
254
|
-
<url>file://$PROJECT_DIR$/__tests__/MorphUtils.test.js</url>
|
|
255
|
-
<line>88</line>
|
|
256
|
-
<properties lambdaOrdinal="-1" />
|
|
257
|
-
<option name="timeStamp" value="13" />
|
|
258
|
-
</line-breakpoint>
|
|
259
|
-
<line-breakpoint enabled="true" type="javascript">
|
|
260
|
-
<url>file://$PROJECT_DIR$/src/js/utils/MorphUtils.js</url>
|
|
261
|
-
<line>150</line>
|
|
262
|
-
<properties lambdaOrdinal="-1" />
|
|
263
|
-
<option name="timeStamp" value="14" />
|
|
264
|
-
</line-breakpoint>
|
|
265
|
-
</breakpoints>
|
|
266
|
-
</breakpoint-manager>
|
|
267
|
-
</component>
|
|
268
|
-
</project>
|