hebrew-transliteration 2.3.0 → 2.4.0
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/README.md +103 -5
- package/dist/hebCharsTrans.d.ts.map +1 -0
- package/dist/hebCharsTrans.js +1 -0
- package/dist/hebCharsTrans.js.map +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/mapChars.d.ts.map +1 -0
- package/dist/mapChars.js +1 -0
- package/dist/mapChars.js.map +1 -0
- package/dist/remove.d.ts.map +1 -0
- package/dist/remove.js +1 -0
- package/dist/remove.js.map +1 -0
- package/dist/rules.d.ts +27 -0
- package/dist/rules.d.ts.map +1 -0
- package/dist/rules.js +208 -118
- package/dist/rules.js.map +1 -0
- package/dist/schema.d.ts +360 -28
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +72 -65
- package/dist/schema.js.map +1 -0
- package/dist/schemas/brillAcademic.d.ts.map +1 -0
- package/dist/schemas/brillAcademic.js +6 -3
- package/dist/schemas/brillAcademic.js.map +1 -0
- package/dist/schemas/brillSimple.d.ts.map +1 -0
- package/dist/schemas/brillSimple.js +4 -1
- package/dist/schemas/brillSimple.js.map +1 -0
- package/dist/schemas/index.d.ts +2 -1
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +4 -1
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/michiganClaremont.d.ts.map +1 -0
- package/dist/schemas/michiganClaremont.js +4 -1
- package/dist/schemas/michiganClaremont.js.map +1 -0
- package/dist/schemas/romaniote.js +77 -17
- package/dist/schemas/romaniote.js.map +1 -0
- package/dist/schemas/sblAcademicSpirantization.d.ts.map +1 -0
- package/dist/schemas/sblAcademicSpirantization.js +4 -1
- package/dist/schemas/sblAcademicSpirantization.js.map +1 -0
- package/dist/schemas/sblSimple.d.ts.map +1 -0
- package/dist/schemas/sblSimple.js +4 -1
- package/dist/schemas/sblSimple.js.map +1 -0
- package/dist/schemas/tiberian.d.ts +2 -0
- package/dist/schemas/tiberian.js +215 -0
- package/dist/schemas/tiberian.js.map +1 -0
- package/dist/sequence.d.ts.map +1 -0
- package/dist/sequence.js +1 -0
- package/dist/sequence.js.map +1 -0
- package/dist/transliterate.d.ts.map +1 -0
- package/dist/transliterate.js +2 -1
- package/dist/transliterate.js.map +1 -0
- package/package.json +17 -14
- package/dist/.DS_Store +0 -0
package/dist/rules.js
CHANGED
|
@@ -1,81 +1,77 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.wordRules = exports.sylRules = void 0;
|
|
3
|
+
exports.wordRules = exports.sylRules = exports.replaceAndTransliterate = exports.mapChars = void 0;
|
|
4
4
|
const cluster_1 = require("havarotjs/cluster");
|
|
5
|
+
const syllable_1 = require("havarotjs/syllable");
|
|
6
|
+
const word_1 = require("havarotjs/word");
|
|
5
7
|
const regularExpressions_1 = require("havarotjs/dist/utils/regularExpressions");
|
|
6
|
-
const
|
|
7
|
-
const taamim = /[\u{0590}-\u{05AF}\u{05BD}\u{05BF}]/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (
|
|
53
|
-
return
|
|
54
|
-
}
|
|
55
|
-
if (schema.KAF_DAGESH && /ך\u{05BC}/u.test(clusterText)) {
|
|
56
|
-
return changeElementSplit(clusterText, /ך\u{05BC}/u, schema.KAF_DAGESH.repeat(isDoubled ? 2 : 1));
|
|
57
|
-
}
|
|
58
|
-
if (schema.PE_DAGESH && /פ\u{05BC}/u.test(clusterText)) {
|
|
59
|
-
return changeElementSplit(clusterText, /פ\u{05BC}/u, schema.PE_DAGESH.repeat(isDoubled ? 2 : 1));
|
|
60
|
-
}
|
|
61
|
-
if (schema.TAV_DAGESH && /ת\u{05BC}/u.test(clusterText)) {
|
|
62
|
-
return changeElementSplit(clusterText, /ת\u{05BC}/u, schema.TAV_DAGESH.repeat(isDoubled ? 2 : 1));
|
|
63
|
-
}
|
|
64
|
-
if (/ש\u{05C1}/u.test(clusterText)) {
|
|
65
|
-
return changeElementSplit(clusterText, /ש\u{05C1}/u, schema.SHIN.repeat(isDoubled ? 2 : 1));
|
|
66
|
-
}
|
|
67
|
-
if (/ש\u{05C2}/u.test(clusterText)) {
|
|
68
|
-
return changeElementSplit(clusterText, /ש\u{05C2}/u, schema.SIN.repeat(isDoubled ? 2 : 1));
|
|
69
|
-
}
|
|
70
|
-
if (isDoubled) {
|
|
71
|
-
const consonant = cluster.chars[0].text;
|
|
72
|
-
const consonantDagesh = new RegExp(consonant + "\u{05BC}", "u");
|
|
73
|
-
return changeElementSplit(clusterText, consonantDagesh, `${consonant + consonant}`);
|
|
8
|
+
const hebCharsTrans_1 = require("./hebCharsTrans");
|
|
9
|
+
const taamim = /[\u{0590}-\u{05AF}\u{05BD}\u{05BF}]/gu;
|
|
10
|
+
/**
|
|
11
|
+
* maps Hebrew characters to schema
|
|
12
|
+
*
|
|
13
|
+
* @param input - text to be transliterated
|
|
14
|
+
* @param schema - a {@link Schema} for transliterating the input
|
|
15
|
+
* @returns transliteration of characters
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
const mapChars = (schema) => (input) => {
|
|
19
|
+
return [...input].map((char) => (char in hebCharsTrans_1.transliterateMap ? schema[hebCharsTrans_1.transliterateMap[char]] : char)).join("");
|
|
20
|
+
};
|
|
21
|
+
exports.mapChars = mapChars;
|
|
22
|
+
/**
|
|
23
|
+
* a wrapper around String.replace() to constrain to a RegExp
|
|
24
|
+
*
|
|
25
|
+
* @param input the string to be modified
|
|
26
|
+
* @param regex the regex to be used as the search value
|
|
27
|
+
* @param replaceValue the string to replace the regex
|
|
28
|
+
* @returns
|
|
29
|
+
*/
|
|
30
|
+
const replaceWithRegex = (input, regex, replaceValue) => input.replace(regex, replaceValue);
|
|
31
|
+
/**
|
|
32
|
+
* replaces part of a string and transliterates the remaining characters according to the schema
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* // replaces בָ as VA, but only when matching the regex sequence
|
|
37
|
+
* const betAndQamats = /\u{05D1}\u{05B8}/u
|
|
38
|
+
* replaceAndTransliterate("דָּבָר", betAndQamats, "VA", schema);
|
|
39
|
+
* // dāVAr
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @param input the text to be transliterated
|
|
43
|
+
* @param regex the regex used as the search value
|
|
44
|
+
* @param replaceValue the string to replace the regex
|
|
45
|
+
* @param schema the Schema
|
|
46
|
+
* @returns
|
|
47
|
+
*/
|
|
48
|
+
const replaceAndTransliterate = (input, regex, replaceValue, schema) => {
|
|
49
|
+
const sylSeq = replaceWithRegex(input, regex, replaceValue);
|
|
50
|
+
return [...sylSeq].map((0, exports.mapChars)(schema)).join("");
|
|
51
|
+
};
|
|
52
|
+
exports.replaceAndTransliterate = replaceAndTransliterate;
|
|
53
|
+
const getDageshChazaqVal = (input, dagesh, isChazaq) => {
|
|
54
|
+
if (!isChazaq) {
|
|
55
|
+
return input;
|
|
74
56
|
}
|
|
75
|
-
if (
|
|
76
|
-
return
|
|
57
|
+
if (typeof dagesh === "boolean") {
|
|
58
|
+
return input.repeat(2);
|
|
77
59
|
}
|
|
78
|
-
return
|
|
60
|
+
return input + dagesh;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* formats the Divine Name with any Latin chars
|
|
64
|
+
*
|
|
65
|
+
* @param str word text
|
|
66
|
+
* @param schema
|
|
67
|
+
* @returns the Divine Name with any pre or proceding Latin chars
|
|
68
|
+
*/
|
|
69
|
+
const getDivineName = (str, schema) => {
|
|
70
|
+
const begn = str[0];
|
|
71
|
+
const end = str[str.length - 1];
|
|
72
|
+
// if DN is pointed with a hiriq, then it is read as 'elohim
|
|
73
|
+
const divineName = schema.DIVINE_NAME_ELOHIM && /\u{05B4}/u.test(str) ? schema.DIVINE_NAME_ELOHIM : schema.DIVINE_NAME;
|
|
74
|
+
return `${regularExpressions_1.hebChars.test(begn) ? "" : begn}${divineName}${regularExpressions_1.hebChars.test(end) ? "" : end}`;
|
|
79
75
|
};
|
|
80
76
|
const materFeatures = (syl, schema) => {
|
|
81
77
|
const mater = syl.clusters.filter((c) => c.isMater)[0];
|
|
@@ -93,51 +89,59 @@ const materFeatures = (syl, schema) => {
|
|
|
93
89
|
if (/י/.test(materText)) {
|
|
94
90
|
// hiriq
|
|
95
91
|
if (/\u{05B4}/u.test(prevText)) {
|
|
96
|
-
return
|
|
92
|
+
return replaceWithRegex(noMaterText, /\u{05B4}/u, schema.HIRIQ_YOD);
|
|
97
93
|
}
|
|
98
94
|
// tsere
|
|
99
95
|
if (/\u{05B5}/u.test(prevText)) {
|
|
100
|
-
return
|
|
96
|
+
return replaceWithRegex(noMaterText, /\u{05B5}/u, schema.TSERE_YOD);
|
|
101
97
|
}
|
|
102
98
|
// segol
|
|
103
99
|
if (/\u{05B6}/u.test(prevText)) {
|
|
104
|
-
return
|
|
100
|
+
return replaceWithRegex(noMaterText, /\u{05B6}/u, schema.SEGOL_YOD);
|
|
105
101
|
}
|
|
106
102
|
}
|
|
107
103
|
if (/ו/u.test(materText)) {
|
|
108
104
|
// holam
|
|
109
105
|
if (/\u{05B9}/u.test(prevText)) {
|
|
110
|
-
return
|
|
106
|
+
return replaceWithRegex(noMaterText, /\u{05B9}/u, schema.HOLAM_VAV);
|
|
111
107
|
}
|
|
112
108
|
}
|
|
113
109
|
if (/ה/.test(materText)) {
|
|
114
110
|
// qamets
|
|
115
111
|
if (/\u{05B8}/u.test(prevText)) {
|
|
116
|
-
return
|
|
112
|
+
return replaceWithRegex(noMaterText, /\u{05B8}/u, schema.QAMATS_HE);
|
|
117
113
|
}
|
|
118
114
|
// seghol
|
|
119
115
|
if (/\u{05B6}/u.test(prevText)) {
|
|
120
|
-
return
|
|
116
|
+
return replaceWithRegex(noMaterText, /\u{05B6}/u, schema.SEGOL_HE);
|
|
121
117
|
}
|
|
122
118
|
// tsere
|
|
123
119
|
if (/\u{05B5}/u.test(prevText)) {
|
|
124
|
-
return
|
|
120
|
+
return replaceWithRegex(noMaterText, /\u{05B5}/u, schema.SEGOL_HE);
|
|
125
121
|
}
|
|
126
122
|
}
|
|
127
123
|
return materText;
|
|
128
124
|
};
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
125
|
+
const joinSyllableChars = (syl, sylChars, schema) => {
|
|
126
|
+
var _a, _b;
|
|
127
|
+
if (!syl.isAccented) {
|
|
128
|
+
return sylChars.map((0, exports.mapChars)(schema)).join("");
|
|
132
129
|
}
|
|
133
|
-
if (schema.STRESS_MARKER) {
|
|
130
|
+
if (schema.STRESS_MARKER && syl.vowel) {
|
|
131
|
+
const exclude = (_b = (_a = schema.STRESS_MARKER) === null || _a === void 0 ? void 0 : _a.exclude) !== null && _b !== void 0 ? _b : "never";
|
|
132
|
+
if (exclude === "single" && !syl.prev && !syl.next) {
|
|
133
|
+
return sylChars.map((0, exports.mapChars)(schema)).join("");
|
|
134
|
+
}
|
|
135
|
+
if (exclude === "final" && !syl.next) {
|
|
136
|
+
return sylChars.map((0, exports.mapChars)(schema)).join("");
|
|
137
|
+
}
|
|
134
138
|
const location = schema.STRESS_MARKER.location;
|
|
135
139
|
const mark = schema.STRESS_MARKER.mark;
|
|
136
140
|
if (location === "before-syllable") {
|
|
137
|
-
return `${mark}${sylChars.map((
|
|
141
|
+
return `${mark}${sylChars.map((0, exports.mapChars)(schema)).join("")}`;
|
|
138
142
|
}
|
|
139
143
|
if (location === "after-syllable") {
|
|
140
|
-
return `${sylChars.map((
|
|
144
|
+
return `${sylChars.map((0, exports.mapChars)(schema)).join("")}${mark}`;
|
|
141
145
|
}
|
|
142
146
|
const vowels = [
|
|
143
147
|
schema.PATAH,
|
|
@@ -161,7 +165,7 @@ const joinChars = (isAccented, sylChars, schema) => {
|
|
|
161
165
|
schema.SHUREQ
|
|
162
166
|
].sort((a, b) => b.length - a.length);
|
|
163
167
|
const vowelRgx = new RegExp(`${vowels.join("|")}`);
|
|
164
|
-
const str = sylChars.map((
|
|
168
|
+
const str = sylChars.map((0, exports.mapChars)(schema)).join("");
|
|
165
169
|
const match = str.match(vowelRgx);
|
|
166
170
|
if (location === "before-vowel") {
|
|
167
171
|
return (match === null || match === void 0 ? void 0 : match.length) ? str.replace(match[0], `${mark}${match[0]}`) : str;
|
|
@@ -169,57 +173,134 @@ const joinChars = (isAccented, sylChars, schema) => {
|
|
|
169
173
|
// after-vowel
|
|
170
174
|
return (match === null || match === void 0 ? void 0 : match.length) ? str.replace(match[0], `${match[0]}${mark}`) : str;
|
|
171
175
|
}
|
|
172
|
-
return sylChars.map((
|
|
176
|
+
return sylChars.map((0, exports.mapChars)(schema)).join("");
|
|
177
|
+
};
|
|
178
|
+
const consonantFeatures = (clusterText, syl, cluster, schema) => {
|
|
179
|
+
var _a, _b;
|
|
180
|
+
if ((_a = schema.ADDITIONAL_FEATURES) === null || _a === void 0 ? void 0 : _a.length) {
|
|
181
|
+
const seqs = schema.ADDITIONAL_FEATURES;
|
|
182
|
+
for (const seq of seqs) {
|
|
183
|
+
const heb = new RegExp(seq.HEBREW, "u");
|
|
184
|
+
if (seq.FEATURE === "cluster" && heb.test(clusterText)) {
|
|
185
|
+
const transliteration = seq.TRANSLITERATION;
|
|
186
|
+
const passThrough = (_b = seq.PASS_THROUGH) !== null && _b !== void 0 ? _b : true;
|
|
187
|
+
if (typeof transliteration === "string") {
|
|
188
|
+
return (0, exports.replaceAndTransliterate)(clusterText, heb, transliteration, schema);
|
|
189
|
+
}
|
|
190
|
+
if (!passThrough) {
|
|
191
|
+
return transliteration(cluster, seq.HEBREW, schema);
|
|
192
|
+
}
|
|
193
|
+
clusterText = transliteration(cluster, seq.HEBREW, schema);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
clusterText = cluster.hasShewa && syl.isClosed ? clusterText.replace(/\u{05B0}/u, "") : clusterText;
|
|
198
|
+
// mappiq he
|
|
199
|
+
if (/ה\u{05BC}$/mu.test(clusterText)) {
|
|
200
|
+
return replaceWithRegex(clusterText, /ה\u{05BC}/u, schema.HE);
|
|
201
|
+
}
|
|
202
|
+
if (syl.isFinal && !syl.isClosed) {
|
|
203
|
+
const furtiveChet = /\u{05D7}\u{05B7}$/mu;
|
|
204
|
+
if (furtiveChet.test(clusterText)) {
|
|
205
|
+
return replaceWithRegex(clusterText, furtiveChet, "\u{05B7}\u{05D7}");
|
|
206
|
+
}
|
|
207
|
+
const furtiveAyin = /\u{05E2}\u{05B7}$/mu;
|
|
208
|
+
if (furtiveAyin.test(clusterText)) {
|
|
209
|
+
return replaceWithRegex(clusterText, furtiveAyin, "\u{05B7}\u{05E2}");
|
|
210
|
+
}
|
|
211
|
+
const furtiveHe = /\u{05D4}\u{05BC}\u{05B7}$/mu;
|
|
212
|
+
if (furtiveHe.test(clusterText)) {
|
|
213
|
+
return replaceWithRegex(clusterText, furtiveHe, "\u{05B7}\u{05D4}\u{05BC}");
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
// dagesh chazaq
|
|
217
|
+
const prevHasVowel = cluster.prev instanceof cluster_1.Cluster ? cluster.prev.hasVowel : false;
|
|
218
|
+
const dageshChazaq = schema.DAGESH_CHAZAQ;
|
|
219
|
+
const isDageshChazq = (dageshChazaq && prevHasVowel && /\u{05BC}/u.test(clusterText)) || false;
|
|
220
|
+
if (schema.BET_DAGESH && /ב\u{05BC}/u.test(clusterText)) {
|
|
221
|
+
return replaceWithRegex(clusterText, /ב\u{05BC}/u, getDageshChazaqVal(schema.BET_DAGESH, dageshChazaq, isDageshChazq));
|
|
222
|
+
}
|
|
223
|
+
if (schema.GIMEL_DAGESH && /ג\u{05BC}/u.test(clusterText)) {
|
|
224
|
+
return replaceWithRegex(clusterText, /ג\u{05BC}/u, getDageshChazaqVal(schema.GIMEL_DAGESH, dageshChazaq, isDageshChazq));
|
|
225
|
+
}
|
|
226
|
+
if (schema.DALET_DAGESH && /ד\u{05BC}/u.test(clusterText)) {
|
|
227
|
+
return replaceWithRegex(clusterText, /ד\u{05BC}/u, getDageshChazaqVal(schema.DALET_DAGESH, dageshChazaq, isDageshChazq));
|
|
228
|
+
}
|
|
229
|
+
if (schema.KAF_DAGESH && /כ\u{05BC}/u.test(clusterText)) {
|
|
230
|
+
return replaceWithRegex(clusterText, /כ\u{05BC}/u, getDageshChazaqVal(schema.KAF_DAGESH, dageshChazaq, isDageshChazq));
|
|
231
|
+
}
|
|
232
|
+
if (schema.KAF_DAGESH && /ך\u{05BC}/u.test(clusterText)) {
|
|
233
|
+
return replaceWithRegex(clusterText, /ך\u{05BC}/u, getDageshChazaqVal(schema.KAF_DAGESH, dageshChazaq, isDageshChazq));
|
|
234
|
+
}
|
|
235
|
+
if (schema.PE_DAGESH && /פ\u{05BC}/u.test(clusterText)) {
|
|
236
|
+
return replaceWithRegex(clusterText, /פ\u{05BC}/u, getDageshChazaqVal(schema.PE_DAGESH, dageshChazaq, isDageshChazq));
|
|
237
|
+
}
|
|
238
|
+
if (schema.TAV_DAGESH && /ת\u{05BC}/u.test(clusterText)) {
|
|
239
|
+
return replaceWithRegex(clusterText, /ת\u{05BC}/u, getDageshChazaqVal(schema.TAV_DAGESH, dageshChazaq, isDageshChazq));
|
|
240
|
+
}
|
|
241
|
+
if (/ש\u{05C1}/u.test(clusterText)) {
|
|
242
|
+
return replaceWithRegex(clusterText, /ש\u{05C1}/u, getDageshChazaqVal(schema.SHIN, dageshChazaq, isDageshChazq));
|
|
243
|
+
}
|
|
244
|
+
if (/ש\u{05C2}/u.test(clusterText)) {
|
|
245
|
+
return replaceWithRegex(clusterText, /ש\u{05C2}/u, getDageshChazaqVal(schema.SIN, schema.DAGESH_CHAZAQ, isDageshChazq));
|
|
246
|
+
}
|
|
247
|
+
if (isDageshChazq) {
|
|
248
|
+
const consonant = cluster.chars[0].text;
|
|
249
|
+
const consonantDagesh = new RegExp(consonant + "\u{05BC}", "u");
|
|
250
|
+
return replaceWithRegex(clusterText, consonantDagesh, getDageshChazaqVal(consonant, schema.DAGESH_CHAZAQ, isDageshChazq));
|
|
251
|
+
}
|
|
252
|
+
if (cluster.isShureq) {
|
|
253
|
+
return clusterText.replace("וּ", schema.SHUREQ);
|
|
254
|
+
}
|
|
255
|
+
return clusterText;
|
|
173
256
|
};
|
|
174
257
|
const sylRules = (syl, schema) => {
|
|
175
|
-
var _a;
|
|
258
|
+
var _a, _b;
|
|
176
259
|
const sylTxt = syl.text.replace(taamim, "");
|
|
177
260
|
if ((_a = schema.ADDITIONAL_FEATURES) === null || _a === void 0 ? void 0 : _a.length) {
|
|
178
|
-
const
|
|
179
|
-
for (const seq of
|
|
261
|
+
const seqs = schema.ADDITIONAL_FEATURES;
|
|
262
|
+
for (const seq of seqs) {
|
|
180
263
|
const heb = new RegExp(seq.HEBREW, "u");
|
|
181
|
-
if (heb.test(sylTxt)) {
|
|
182
|
-
const
|
|
183
|
-
|
|
264
|
+
if (seq.FEATURE === "syllable" && heb.test(sylTxt)) {
|
|
265
|
+
const transliteration = seq.TRANSLITERATION;
|
|
266
|
+
const passThrough = (_b = seq.PASS_THROUGH) !== null && _b !== void 0 ? _b : true;
|
|
267
|
+
if (typeof transliteration === "string") {
|
|
268
|
+
return (0, exports.replaceAndTransliterate)(sylTxt, heb, transliteration, schema);
|
|
269
|
+
}
|
|
270
|
+
if (!passThrough) {
|
|
271
|
+
return transliteration(syl, seq.HEBREW, schema);
|
|
272
|
+
}
|
|
273
|
+
// this is the only way to make the "// regular syllables" block work
|
|
274
|
+
syl = new syllable_1.Syllable([new cluster_1.Cluster(transliteration(syl, seq.HEBREW, schema))], {
|
|
275
|
+
isClosed: syl.isClosed,
|
|
276
|
+
isAccented: syl.isAccented,
|
|
277
|
+
isFinal: syl.isFinal
|
|
278
|
+
});
|
|
184
279
|
}
|
|
185
280
|
}
|
|
186
281
|
}
|
|
187
282
|
// syllable is 3ms sufx
|
|
188
283
|
const mSSuffix = /\u{05B8}\u{05D9}\u{05D5}/u;
|
|
189
284
|
if (syl.isFinal && mSSuffix.test(sylTxt)) {
|
|
190
|
-
const sufxSyl =
|
|
191
|
-
return
|
|
285
|
+
const sufxSyl = replaceWithRegex(sylTxt, mSSuffix, schema.MS_SUFX);
|
|
286
|
+
return joinSyllableChars(syl, [...sufxSyl], schema);
|
|
192
287
|
}
|
|
193
288
|
// syllable has a mater
|
|
194
|
-
// unsure why eslint throwing error here, but not other places...
|
|
195
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment
|
|
196
289
|
const hasMater = syl.clusters.map((c) => c.isMater).includes(true);
|
|
197
290
|
if (hasMater) {
|
|
198
291
|
const materSyl = materFeatures(syl, schema);
|
|
199
|
-
return
|
|
292
|
+
return joinSyllableChars(syl, [...materSyl], schema);
|
|
200
293
|
}
|
|
201
294
|
// regular syllables
|
|
202
295
|
const returnTxt = syl.clusters.map((cluster) => {
|
|
203
296
|
const clusterText = cluster.text.replace(taamim, "");
|
|
204
297
|
return consonantFeatures(clusterText, syl, cluster, schema);
|
|
205
298
|
});
|
|
206
|
-
return
|
|
299
|
+
return joinSyllableChars(syl, returnTxt, schema);
|
|
207
300
|
};
|
|
208
301
|
exports.sylRules = sylRules;
|
|
209
|
-
/**
|
|
210
|
-
* formats the Divine Name with any Latin chars
|
|
211
|
-
*
|
|
212
|
-
* @param str word text
|
|
213
|
-
* @param schema
|
|
214
|
-
* @returns the Divine Name with any pre or proceding Latin chars
|
|
215
|
-
*/
|
|
216
|
-
const getDivineName = (str, schema) => {
|
|
217
|
-
const begn = str[0];
|
|
218
|
-
const end = str[str.length - 1];
|
|
219
|
-
return `${regularExpressions_1.hebChars.test(begn) ? "" : begn}${schema.DIVINE_NAME}${regularExpressions_1.hebChars.test(end) ? "" : end}`;
|
|
220
|
-
};
|
|
221
302
|
const wordRules = (word, schema) => {
|
|
222
|
-
var _a;
|
|
303
|
+
var _a, _b;
|
|
223
304
|
if (word.isDivineName)
|
|
224
305
|
return getDivineName(word.text, schema);
|
|
225
306
|
if (word.hasDivineName)
|
|
@@ -227,16 +308,25 @@ const wordRules = (word, schema) => {
|
|
|
227
308
|
if (word.isNotHebrew)
|
|
228
309
|
return word.text;
|
|
229
310
|
if ((_a = schema.ADDITIONAL_FEATURES) === null || _a === void 0 ? void 0 : _a.length) {
|
|
230
|
-
const
|
|
231
|
-
for (const seq of
|
|
311
|
+
const seqs = schema.ADDITIONAL_FEATURES;
|
|
312
|
+
for (const seq of seqs) {
|
|
232
313
|
const heb = new RegExp(seq.HEBREW, "u");
|
|
233
|
-
const
|
|
234
|
-
if (heb.test(
|
|
235
|
-
const
|
|
236
|
-
|
|
314
|
+
const text = word.text.replace(taamim, "");
|
|
315
|
+
if (seq.FEATURE === "word" && heb.test(text)) {
|
|
316
|
+
const transliteration = seq.TRANSLITERATION;
|
|
317
|
+
const passThrough = (_b = seq.PASS_THROUGH) !== null && _b !== void 0 ? _b : true;
|
|
318
|
+
if (typeof transliteration === "string") {
|
|
319
|
+
return (0, exports.replaceAndTransliterate)(text, heb, transliteration, schema);
|
|
320
|
+
}
|
|
321
|
+
if (!passThrough) {
|
|
322
|
+
return transliteration(word, seq.HEBREW, schema);
|
|
323
|
+
}
|
|
324
|
+
return new word_1.Word(transliteration(word, seq.HEBREW, schema), schema);
|
|
237
325
|
}
|
|
238
326
|
}
|
|
327
|
+
return word;
|
|
239
328
|
}
|
|
240
329
|
return word;
|
|
241
330
|
};
|
|
242
331
|
exports.wordRules = wordRules;
|
|
332
|
+
//# sourceMappingURL=rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../src/rules.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAC5C,iDAA8C;AAC9C,yCAAsC;AACtC,gFAAmE;AAEnE,mDAA0D;AAE1D,MAAM,MAAM,GAAG,uCAAuC,CAAC;AAEvD;;;;;;;GAOG;AACI,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC,KAAa,EAAE,EAAE;IAC5D,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,gCAAG,CAAC,CAAC,CAAC,MAAM,CAAC,gCAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC7F,CAAC,CAAC;AAFW,QAAA,QAAQ,YAEnB;AAEF;;;;;;;GAOG;AACH,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAE,KAAa,EAAE,YAAoB,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;AAEpH;;;;;;;;;;;;;;;;GAgBG;AACI,MAAM,uBAAuB,GAAG,CAAC,KAAa,EAAE,KAAa,EAAE,YAAoB,EAAE,MAAc,EAAE,EAAE;IAC5G,MAAM,MAAM,GAAG,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC;IAC5D,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,IAAA,gBAAQ,EAAC,MAAM,C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