hebrew-transliteration 2.3.1 → 2.5.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 +18 -0
- package/dist/rules.d.ts.map +1 -0
- package/dist/rules.js +217 -119
- package/dist/rules.js.map +1 -0
- package/dist/schema.d.ts +356 -25
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +71 -66
- package/dist/schema.js.map +1 -0
- package/dist/schemas/brillAcademic.d.ts.map +1 -0
- package/dist/schemas/brillAcademic.js +4 -2
- package/dist/schemas/brillAcademic.js.map +1 -0
- package/dist/schemas/brillSimple.d.ts.map +1 -0
- package/dist/schemas/brillSimple.js +2 -0
- package/dist/schemas/brillSimple.js.map +1 -0
- package/dist/schemas/index.d.ts +3 -1
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +6 -1
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/jss.d.ts +2 -0
- package/dist/schemas/jss.js +93 -0
- package/dist/schemas/jss.js.map +1 -0
- package/dist/schemas/michiganClaremont.d.ts.map +1 -0
- package/dist/schemas/michiganClaremont.js +2 -0
- package/dist/schemas/michiganClaremont.js.map +1 -0
- package/dist/schemas/romaniote.d.ts +2 -0
- package/dist/schemas/romaniote.js +169 -0
- package/dist/schemas/romaniote.js.map +1 -0
- package/dist/schemas/sblAcademicSpirantization.d.ts.map +1 -0
- package/dist/schemas/sblAcademicSpirantization.js +2 -0
- package/dist/schemas/sblAcademicSpirantization.js.map +1 -0
- package/dist/schemas/sblSimple.d.ts.map +1 -0
- package/dist/schemas/sblSimple.js +2 -0
- package/dist/schemas/sblSimple.js.map +1 -0
- package/dist/schemas/sephardicIPA.d.ts +2 -0
- package/dist/schemas/sephardicIPA.js +83 -0
- package/dist/schemas/sephardicIPA.js.map +1 -0
- package/dist/schemas/tiberian.d.ts +2 -0
- package/dist/schemas/tiberian.js +309 -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/rules.js
CHANGED
|
@@ -1,81 +1,76 @@
|
|
|
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 = 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
|
-
|
|
53
|
-
return changeElementSplit(clusterText, /כ\u{05BC}/u, schema.KAF_DAGESH.repeat(isDoubled ? 2 : 1));
|
|
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
|
+
/**
|
|
22
|
+
* a wrapper around String.replace() to constrain to a RegExp
|
|
23
|
+
*
|
|
24
|
+
* @param input the string to be modified
|
|
25
|
+
* @param regex the regex to be used as the search value
|
|
26
|
+
* @param replaceValue the string to replace the regex
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
const replaceWithRegex = (input, regex, replaceValue) => input.replace(regex, replaceValue);
|
|
30
|
+
/**
|
|
31
|
+
* replaces part of a string and transliterates the remaining characters according to the schema
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* // replaces בָ as VA, but only when matching the regex sequence
|
|
36
|
+
* const betAndQamats = /\u{05D1}\u{05B8}/u
|
|
37
|
+
* replaceAndTransliterate("דָּבָר", betAndQamats, "VA", schema);
|
|
38
|
+
* // dāVAr
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @param input the text to be transliterated
|
|
42
|
+
* @param regex the regex used as the search value
|
|
43
|
+
* @param replaceValue the string to replace the regex
|
|
44
|
+
* @param schema the Schema
|
|
45
|
+
* @returns
|
|
46
|
+
*/
|
|
47
|
+
const replaceAndTransliterate = (input, regex, replaceValue, schema) => {
|
|
48
|
+
const sylSeq = replaceWithRegex(input, regex, replaceValue);
|
|
49
|
+
return [...sylSeq].map(mapChars(schema)).join("");
|
|
50
|
+
};
|
|
51
|
+
exports.replaceAndTransliterate = replaceAndTransliterate;
|
|
52
|
+
const getDageshChazaqVal = (input, dagesh, isChazaq) => {
|
|
53
|
+
if (!isChazaq) {
|
|
54
|
+
return input;
|
|
74
55
|
}
|
|
75
|
-
if (
|
|
76
|
-
return
|
|
56
|
+
if (typeof dagesh === "boolean") {
|
|
57
|
+
return input.repeat(2);
|
|
77
58
|
}
|
|
78
|
-
return
|
|
59
|
+
return input + dagesh;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* formats the Divine Name with any Latin chars
|
|
63
|
+
*
|
|
64
|
+
* @param str word text
|
|
65
|
+
* @param schema
|
|
66
|
+
* @returns the Divine Name with any pre or proceding Latin chars
|
|
67
|
+
*/
|
|
68
|
+
const getDivineName = (str, schema) => {
|
|
69
|
+
const begn = str[0];
|
|
70
|
+
const end = str[str.length - 1];
|
|
71
|
+
// if DN is pointed with a hiriq, then it is read as 'elohim
|
|
72
|
+
const divineName = schema.DIVINE_NAME_ELOHIM && /\u{05B4}/u.test(str) ? schema.DIVINE_NAME_ELOHIM : schema.DIVINE_NAME;
|
|
73
|
+
return `${regularExpressions_1.hebChars.test(begn) ? "" : begn}${divineName}${regularExpressions_1.hebChars.test(end) ? "" : end}`;
|
|
79
74
|
};
|
|
80
75
|
const materFeatures = (syl, schema) => {
|
|
81
76
|
const mater = syl.clusters.filter((c) => c.isMater)[0];
|
|
@@ -93,51 +88,59 @@ const materFeatures = (syl, schema) => {
|
|
|
93
88
|
if (/י/.test(materText)) {
|
|
94
89
|
// hiriq
|
|
95
90
|
if (/\u{05B4}/u.test(prevText)) {
|
|
96
|
-
return
|
|
91
|
+
return replaceWithRegex(noMaterText, /\u{05B4}/u, schema.HIRIQ_YOD);
|
|
97
92
|
}
|
|
98
93
|
// tsere
|
|
99
94
|
if (/\u{05B5}/u.test(prevText)) {
|
|
100
|
-
return
|
|
95
|
+
return replaceWithRegex(noMaterText, /\u{05B5}/u, schema.TSERE_YOD);
|
|
101
96
|
}
|
|
102
97
|
// segol
|
|
103
98
|
if (/\u{05B6}/u.test(prevText)) {
|
|
104
|
-
return
|
|
99
|
+
return replaceWithRegex(noMaterText, /\u{05B6}/u, schema.SEGOL_YOD);
|
|
105
100
|
}
|
|
106
101
|
}
|
|
107
102
|
if (/ו/u.test(materText)) {
|
|
108
103
|
// holam
|
|
109
104
|
if (/\u{05B9}/u.test(prevText)) {
|
|
110
|
-
return
|
|
105
|
+
return replaceWithRegex(noMaterText, /\u{05B9}/u, schema.HOLAM_VAV);
|
|
111
106
|
}
|
|
112
107
|
}
|
|
113
108
|
if (/ה/.test(materText)) {
|
|
114
109
|
// qamets
|
|
115
110
|
if (/\u{05B8}/u.test(prevText)) {
|
|
116
|
-
return
|
|
111
|
+
return replaceWithRegex(noMaterText, /\u{05B8}/u, schema.QAMATS_HE);
|
|
117
112
|
}
|
|
118
113
|
// seghol
|
|
119
114
|
if (/\u{05B6}/u.test(prevText)) {
|
|
120
|
-
return
|
|
115
|
+
return replaceWithRegex(noMaterText, /\u{05B6}/u, schema.SEGOL_HE);
|
|
121
116
|
}
|
|
122
117
|
// tsere
|
|
123
118
|
if (/\u{05B5}/u.test(prevText)) {
|
|
124
|
-
return
|
|
119
|
+
return replaceWithRegex(noMaterText, /\u{05B5}/u, schema.TSERE_HE);
|
|
125
120
|
}
|
|
126
121
|
}
|
|
127
122
|
return materText;
|
|
128
123
|
};
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
124
|
+
const joinSyllableChars = (syl, sylChars, schema) => {
|
|
125
|
+
var _a, _b;
|
|
126
|
+
if (!syl.isAccented) {
|
|
127
|
+
return sylChars.map(mapChars(schema)).join("");
|
|
132
128
|
}
|
|
133
|
-
if (schema.STRESS_MARKER) {
|
|
129
|
+
if (schema.STRESS_MARKER && syl.vowel) {
|
|
130
|
+
const exclude = (_b = (_a = schema.STRESS_MARKER) === null || _a === void 0 ? void 0 : _a.exclude) !== null && _b !== void 0 ? _b : "never";
|
|
131
|
+
if (exclude === "single" && !syl.prev && !syl.next) {
|
|
132
|
+
return sylChars.map(mapChars(schema)).join("");
|
|
133
|
+
}
|
|
134
|
+
if (exclude === "final" && !syl.next) {
|
|
135
|
+
return sylChars.map(mapChars(schema)).join("");
|
|
136
|
+
}
|
|
134
137
|
const location = schema.STRESS_MARKER.location;
|
|
135
138
|
const mark = schema.STRESS_MARKER.mark;
|
|
136
139
|
if (location === "before-syllable") {
|
|
137
|
-
return `${mark}${sylChars.map(
|
|
140
|
+
return `${mark}${sylChars.map(mapChars(schema)).join("")}`;
|
|
138
141
|
}
|
|
139
142
|
if (location === "after-syllable") {
|
|
140
|
-
return `${sylChars.map(
|
|
143
|
+
return `${sylChars.map(mapChars(schema)).join("")}${mark}`;
|
|
141
144
|
}
|
|
142
145
|
const vowels = [
|
|
143
146
|
schema.PATAH,
|
|
@@ -161,7 +164,7 @@ const joinChars = (isAccented, sylChars, schema) => {
|
|
|
161
164
|
schema.SHUREQ
|
|
162
165
|
].sort((a, b) => b.length - a.length);
|
|
163
166
|
const vowelRgx = new RegExp(`${vowels.join("|")}`);
|
|
164
|
-
const str = sylChars.map(
|
|
167
|
+
const str = sylChars.map(mapChars(schema)).join("");
|
|
165
168
|
const match = str.match(vowelRgx);
|
|
166
169
|
if (location === "before-vowel") {
|
|
167
170
|
return (match === null || match === void 0 ? void 0 : match.length) ? str.replace(match[0], `${mark}${match[0]}`) : str;
|
|
@@ -169,57 +172,143 @@ const joinChars = (isAccented, sylChars, schema) => {
|
|
|
169
172
|
// after-vowel
|
|
170
173
|
return (match === null || match === void 0 ? void 0 : match.length) ? str.replace(match[0], `${match[0]}${mark}`) : str;
|
|
171
174
|
}
|
|
172
|
-
return sylChars.map(
|
|
175
|
+
return sylChars.map(mapChars(schema)).join("");
|
|
176
|
+
};
|
|
177
|
+
const consonantFeatures = (clusterText, syl, cluster, schema) => {
|
|
178
|
+
var _a, _b;
|
|
179
|
+
if ((_a = schema.ADDITIONAL_FEATURES) === null || _a === void 0 ? void 0 : _a.length) {
|
|
180
|
+
const seqs = schema.ADDITIONAL_FEATURES;
|
|
181
|
+
for (const seq of seqs) {
|
|
182
|
+
const heb = new RegExp(seq.HEBREW, "u");
|
|
183
|
+
if (seq.FEATURE === "cluster" && heb.test(clusterText)) {
|
|
184
|
+
const transliteration = seq.TRANSLITERATION;
|
|
185
|
+
const passThrough = (_b = seq.PASS_THROUGH) !== null && _b !== void 0 ? _b : true;
|
|
186
|
+
if (typeof transliteration === "string") {
|
|
187
|
+
return (0, exports.replaceAndTransliterate)(clusterText, heb, transliteration, schema);
|
|
188
|
+
}
|
|
189
|
+
if (!passThrough) {
|
|
190
|
+
return transliteration(cluster, seq.HEBREW, schema);
|
|
191
|
+
}
|
|
192
|
+
clusterText = transliteration(cluster, seq.HEBREW, schema);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
clusterText = cluster.hasSheva && syl.isClosed ? clusterText.replace(/\u{05B0}/u, "") : clusterText;
|
|
197
|
+
// mappiq he
|
|
198
|
+
if (/ה\u{05BC}$/mu.test(clusterText)) {
|
|
199
|
+
return replaceWithRegex(clusterText, /ה\u{05BC}/u, schema.HE);
|
|
200
|
+
}
|
|
201
|
+
if (syl.isFinal && !syl.isClosed) {
|
|
202
|
+
const furtiveChet = /\u{05D7}\u{05B7}$/mu;
|
|
203
|
+
if (furtiveChet.test(clusterText)) {
|
|
204
|
+
return replaceWithRegex(clusterText, furtiveChet, "\u{05B7}\u{05D7}");
|
|
205
|
+
}
|
|
206
|
+
const furtiveAyin = /\u{05E2}\u{05B7}$/mu;
|
|
207
|
+
if (furtiveAyin.test(clusterText)) {
|
|
208
|
+
return replaceWithRegex(clusterText, furtiveAyin, "\u{05B7}\u{05E2}");
|
|
209
|
+
}
|
|
210
|
+
const furtiveHe = /\u{05D4}\u{05BC}\u{05B7}$/mu;
|
|
211
|
+
if (furtiveHe.test(clusterText)) {
|
|
212
|
+
return replaceWithRegex(clusterText, furtiveHe, "\u{05B7}\u{05D4}\u{05BC}");
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
// dagesh chazaq
|
|
216
|
+
const prevHasVowel = cluster.prev instanceof cluster_1.Cluster ? cluster.prev.hasVowel : false;
|
|
217
|
+
const dageshChazaq = schema.DAGESH_CHAZAQ;
|
|
218
|
+
const isDageshChazq = (dageshChazaq && prevHasVowel && /\u{05BC}/u.test(clusterText)) || false;
|
|
219
|
+
if (schema.BET_DAGESH && /ב\u{05BC}/u.test(clusterText)) {
|
|
220
|
+
return replaceWithRegex(clusterText, /ב\u{05BC}/u, getDageshChazaqVal(schema.BET_DAGESH, dageshChazaq, isDageshChazq));
|
|
221
|
+
}
|
|
222
|
+
if (schema.GIMEL_DAGESH && /ג\u{05BC}/u.test(clusterText)) {
|
|
223
|
+
return replaceWithRegex(clusterText, /ג\u{05BC}/u, getDageshChazaqVal(schema.GIMEL_DAGESH, dageshChazaq, isDageshChazq));
|
|
224
|
+
}
|
|
225
|
+
if (schema.DALET_DAGESH && /ד\u{05BC}/u.test(clusterText)) {
|
|
226
|
+
return replaceWithRegex(clusterText, /ד\u{05BC}/u, getDageshChazaqVal(schema.DALET_DAGESH, dageshChazaq, isDageshChazq));
|
|
227
|
+
}
|
|
228
|
+
if (schema.KAF_DAGESH && /כ\u{05BC}/u.test(clusterText)) {
|
|
229
|
+
return replaceWithRegex(clusterText, /כ\u{05BC}/u, getDageshChazaqVal(schema.KAF_DAGESH, dageshChazaq, isDageshChazq));
|
|
230
|
+
}
|
|
231
|
+
if (schema.KAF_DAGESH && /ך\u{05BC}/u.test(clusterText)) {
|
|
232
|
+
return replaceWithRegex(clusterText, /ך\u{05BC}/u, getDageshChazaqVal(schema.KAF_DAGESH, dageshChazaq, isDageshChazq));
|
|
233
|
+
}
|
|
234
|
+
if (schema.PE_DAGESH && /פ\u{05BC}/u.test(clusterText)) {
|
|
235
|
+
return replaceWithRegex(clusterText, /פ\u{05BC}/u, getDageshChazaqVal(schema.PE_DAGESH, dageshChazaq, isDageshChazq));
|
|
236
|
+
}
|
|
237
|
+
if (schema.TAV_DAGESH && /ת\u{05BC}/u.test(clusterText)) {
|
|
238
|
+
return replaceWithRegex(clusterText, /ת\u{05BC}/u, getDageshChazaqVal(schema.TAV_DAGESH, dageshChazaq, isDageshChazq));
|
|
239
|
+
}
|
|
240
|
+
if (/ש\u{05C1}/u.test(clusterText)) {
|
|
241
|
+
return replaceWithRegex(clusterText, /ש\u{05C1}/u, getDageshChazaqVal(schema.SHIN, dageshChazaq, isDageshChazq));
|
|
242
|
+
}
|
|
243
|
+
if (/ש\u{05C2}/u.test(clusterText)) {
|
|
244
|
+
return replaceWithRegex(clusterText, /ש\u{05C2}/u, getDageshChazaqVal(schema.SIN, schema.DAGESH_CHAZAQ, isDageshChazq));
|
|
245
|
+
}
|
|
246
|
+
if (isDageshChazq) {
|
|
247
|
+
const consonant = cluster.chars[0].text;
|
|
248
|
+
const consonantDagesh = new RegExp(consonant + "\u{05BC}", "u");
|
|
249
|
+
return replaceWithRegex(clusterText, consonantDagesh, getDageshChazaqVal(consonant, schema.DAGESH_CHAZAQ, isDageshChazq));
|
|
250
|
+
}
|
|
251
|
+
if (cluster.isShureq) {
|
|
252
|
+
return clusterText.replace("וּ", schema.SHUREQ);
|
|
253
|
+
}
|
|
254
|
+
return clusterText;
|
|
173
255
|
};
|
|
174
256
|
const sylRules = (syl, schema) => {
|
|
175
|
-
var _a;
|
|
257
|
+
var _a, _b;
|
|
176
258
|
const sylTxt = syl.text.replace(taamim, "");
|
|
177
259
|
if ((_a = schema.ADDITIONAL_FEATURES) === null || _a === void 0 ? void 0 : _a.length) {
|
|
178
|
-
const
|
|
179
|
-
for (const seq of
|
|
260
|
+
const seqs = schema.ADDITIONAL_FEATURES;
|
|
261
|
+
for (const seq of seqs) {
|
|
180
262
|
const heb = new RegExp(seq.HEBREW, "u");
|
|
181
|
-
if (heb.test(sylTxt)) {
|
|
182
|
-
const
|
|
183
|
-
|
|
263
|
+
if (seq.FEATURE === "syllable" && heb.test(sylTxt)) {
|
|
264
|
+
const transliteration = seq.TRANSLITERATION;
|
|
265
|
+
const passThrough = (_b = seq.PASS_THROUGH) !== null && _b !== void 0 ? _b : true;
|
|
266
|
+
// if transliteration is a string, then replace
|
|
267
|
+
if (typeof transliteration === "string") {
|
|
268
|
+
return (0, exports.replaceAndTransliterate)(sylTxt, heb, transliteration, schema);
|
|
269
|
+
}
|
|
270
|
+
// if transliteration is a function and passThrough is false, then transliterate and exit
|
|
271
|
+
if (!passThrough) {
|
|
272
|
+
return transliteration(syl, seq.HEBREW, schema);
|
|
273
|
+
}
|
|
274
|
+
// if transliteration is a function and passThrough is true, then transliterate and continue
|
|
275
|
+
const newText = transliteration(syl, seq.HEBREW, schema);
|
|
276
|
+
// if the new text is different, then create a new syllable
|
|
277
|
+
// if the texts are the same, then nothing was changed and copying the syllable becomes dangerous
|
|
278
|
+
if (newText !== sylTxt) {
|
|
279
|
+
const clusterStrings = newText.split(regularExpressions_1.clusterSplitGroup);
|
|
280
|
+
const newClusters = clusterStrings.map((clusterString) => new cluster_1.Cluster(clusterString, true));
|
|
281
|
+
syl = new syllable_1.Syllable(newClusters, {
|
|
282
|
+
isClosed: syl.isClosed,
|
|
283
|
+
isAccented: syl.isAccented,
|
|
284
|
+
isFinal: syl.isFinal
|
|
285
|
+
});
|
|
286
|
+
}
|
|
184
287
|
}
|
|
185
|
-
}
|
|
288
|
+
} // end of seqs loop
|
|
186
289
|
}
|
|
187
290
|
// syllable is 3ms sufx
|
|
188
291
|
const mSSuffix = /\u{05B8}\u{05D9}\u{05D5}/u;
|
|
189
292
|
if (syl.isFinal && mSSuffix.test(sylTxt)) {
|
|
190
|
-
const sufxSyl =
|
|
191
|
-
return
|
|
293
|
+
const sufxSyl = replaceWithRegex(sylTxt, mSSuffix, schema.MS_SUFX);
|
|
294
|
+
return joinSyllableChars(syl, [...sufxSyl], schema);
|
|
192
295
|
}
|
|
193
296
|
// 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
297
|
const hasMater = syl.clusters.map((c) => c.isMater).includes(true);
|
|
197
298
|
if (hasMater) {
|
|
198
299
|
const materSyl = materFeatures(syl, schema);
|
|
199
|
-
return
|
|
300
|
+
return joinSyllableChars(syl, [...materSyl], schema);
|
|
200
301
|
}
|
|
201
302
|
// regular syllables
|
|
202
303
|
const returnTxt = syl.clusters.map((cluster) => {
|
|
203
304
|
const clusterText = cluster.text.replace(taamim, "");
|
|
204
305
|
return consonantFeatures(clusterText, syl, cluster, schema);
|
|
205
306
|
});
|
|
206
|
-
return
|
|
307
|
+
return joinSyllableChars(syl, returnTxt, schema);
|
|
207
308
|
};
|
|
208
309
|
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
310
|
const wordRules = (word, schema) => {
|
|
222
|
-
var _a;
|
|
311
|
+
var _a, _b;
|
|
223
312
|
if (word.isDivineName)
|
|
224
313
|
return getDivineName(word.text, schema);
|
|
225
314
|
if (word.hasDivineName)
|
|
@@ -227,16 +316,25 @@ const wordRules = (word, schema) => {
|
|
|
227
316
|
if (word.isNotHebrew)
|
|
228
317
|
return word.text;
|
|
229
318
|
if ((_a = schema.ADDITIONAL_FEATURES) === null || _a === void 0 ? void 0 : _a.length) {
|
|
230
|
-
const
|
|
231
|
-
for (const seq of
|
|
319
|
+
const seqs = schema.ADDITIONAL_FEATURES;
|
|
320
|
+
for (const seq of seqs) {
|
|
232
321
|
const heb = new RegExp(seq.HEBREW, "u");
|
|
233
|
-
const
|
|
234
|
-
if (heb.test(
|
|
235
|
-
const
|
|
236
|
-
|
|
322
|
+
const text = word.text.replace(taamim, "");
|
|
323
|
+
if (seq.FEATURE === "word" && heb.test(text)) {
|
|
324
|
+
const transliteration = seq.TRANSLITERATION;
|
|
325
|
+
const passThrough = (_b = seq.PASS_THROUGH) !== null && _b !== void 0 ? _b : true;
|
|
326
|
+
if (typeof transliteration === "string") {
|
|
327
|
+
return (0, exports.replaceAndTransliterate)(text, heb, transliteration, schema);
|
|
328
|
+
}
|
|
329
|
+
if (!passThrough) {
|
|
330
|
+
return transliteration(word, seq.HEBREW, schema);
|
|
331
|
+
}
|
|
332
|
+
return new word_1.Word(transliteration(word, seq.HEBREW, schema), schema);
|
|
237
333
|
}
|
|
238
334
|
}
|
|
335
|
+
return word;
|
|
239
336
|
}
|
|
240
337
|
return word;
|
|
241
338
|
};
|
|
242
339
|
exports.wordRules = wordRules;
|
|
340
|
+
//# 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,gFAAsF;AAEtF,mDAA0D;AAE1D,MAAM,MAAM,GAAG,uCAAuC,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC,KAAa,EAAE,EAAE;IACrD,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,EAA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