hebrew-transliteration 2.6.0 → 2.6.2
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/dist/cjs/hebCharsTrans.js +73 -0
- package/dist/cjs/hebCharsTrans.js.map +7 -0
- package/dist/cjs/index.js +40 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/remove.js +195 -0
- package/dist/cjs/remove.js.map +7 -0
- package/dist/cjs/rules.js +367 -0
- package/dist/cjs/rules.js.map +7 -0
- package/dist/cjs/schema.js +200 -0
- package/dist/cjs/schema.js.map +7 -0
- package/dist/cjs/schemas/brillAcademic.js +102 -0
- package/dist/cjs/schemas/brillAcademic.js.map +7 -0
- package/dist/cjs/schemas/brillSimple.js +101 -0
- package/dist/cjs/schemas/brillSimple.js.map +7 -0
- package/dist/cjs/schemas/index.js +49 -0
- package/dist/cjs/schemas/index.js.map +7 -0
- package/dist/cjs/schemas/jss.js +115 -0
- package/dist/cjs/schemas/jss.js.map +7 -0
- package/dist/cjs/schemas/michiganClaremont.js +95 -0
- package/dist/cjs/schemas/michiganClaremont.js.map +7 -0
- package/dist/cjs/schemas/romaniote.js +186 -0
- package/dist/cjs/schemas/romaniote.js.map +7 -0
- package/dist/cjs/schemas/sblAcademicSpirantization.js +101 -0
- package/dist/cjs/schemas/sblAcademicSpirantization.js.map +7 -0
- package/dist/cjs/schemas/sblSimple.js +110 -0
- package/dist/cjs/schemas/sblSimple.js.map +7 -0
- package/dist/cjs/schemas/tiberian.js +467 -0
- package/dist/cjs/schemas/tiberian.js.map +7 -0
- package/dist/cjs/sequence.js +34 -0
- package/dist/cjs/sequence.js.map +7 -0
- package/dist/cjs/transliterate.js +63 -0
- package/dist/cjs/transliterate.js.map +7 -0
- package/dist/{hebCharsTrans.js → esm/hebCharsTrans.js} +1 -4
- package/dist/esm/hebCharsTrans.js.map +1 -0
- package/dist/esm/index.js +11 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/{remove.js → esm/remove.js} +15 -15
- package/dist/esm/remove.js.map +1 -0
- package/dist/{rules.js → esm/rules.js} +40 -52
- package/dist/esm/rules.js.map +1 -0
- package/dist/esm/schema.js +659 -0
- package/dist/esm/schema.js.map +1 -0
- package/dist/{schemas → esm/schemas}/brillAcademic.js +1 -4
- package/dist/esm/schemas/brillAcademic.js.map +1 -0
- package/dist/{schemas → esm/schemas}/brillSimple.js +1 -4
- package/dist/esm/schemas/brillSimple.js.map +1 -0
- package/dist/esm/schemas/index.js +10 -0
- package/dist/esm/schemas/index.js.map +1 -0
- package/dist/{schemas → esm/schemas}/jss.js +2 -6
- package/dist/esm/schemas/jss.js.map +1 -0
- package/dist/{schemas → esm/schemas}/michiganClaremont.js +1 -4
- package/dist/esm/schemas/michiganClaremont.js.map +1 -0
- package/dist/{schemas → esm/schemas}/romaniote.js +4 -7
- package/dist/esm/schemas/romaniote.js.map +1 -0
- package/dist/{schemas → esm/schemas}/sblAcademicSpirantization.js +1 -4
- package/dist/esm/schemas/sblAcademicSpirantization.js.map +1 -0
- package/dist/{schemas → esm/schemas}/sblSimple.js +1 -4
- package/dist/esm/schemas/sblSimple.js.map +1 -0
- package/dist/{schemas → esm/schemas}/tiberian.js +34 -51
- package/dist/esm/schemas/tiberian.js.map +1 -0
- package/dist/{sequence.js → esm/sequence.js} +4 -8
- package/dist/esm/sequence.js.map +1 -0
- package/dist/{transliterate.js → esm/transliterate.js} +12 -17
- package/dist/esm/transliterate.js.map +1 -0
- package/package.json +26 -22
- package/dist/hebCharsTrans.js.map +0 -1
- package/dist/index.js +0 -14
- package/dist/index.js.map +0 -1
- package/dist/remove.js.map +0 -1
- package/dist/rules.js.map +0 -1
- package/dist/schema.js +0 -174
- package/dist/schema.js.map +0 -1
- package/dist/schemas/brillAcademic.js.map +0 -1
- package/dist/schemas/brillSimple.js.map +0 -1
- package/dist/schemas/index.js +0 -20
- package/dist/schemas/index.js.map +0 -1
- package/dist/schemas/jss.js.map +0 -1
- package/dist/schemas/michiganClaremont.js.map +0 -1
- package/dist/schemas/romaniote.js.map +0 -1
- package/dist/schemas/sblAcademicSpirantization.js.map +0 -1
- package/dist/schemas/sblSimple.js.map +0 -1
- package/dist/schemas/tiberian.js.map +0 -1
- package/dist/sequence.js.map +0 -1
- package/dist/transliterate.js.map +0 -1
- /package/dist/{hebCharsTrans.d.ts → types/hebCharsTrans.d.ts} +0 -0
- /package/dist/{index.d.ts → types/index.d.ts} +0 -0
- /package/dist/{remove.d.ts → types/remove.d.ts} +0 -0
- /package/dist/{rules.d.ts → types/rules.d.ts} +0 -0
- /package/dist/{schema.d.ts → types/schema.d.ts} +0 -0
- /package/dist/{schemas → types/schemas}/brillAcademic.d.ts +0 -0
- /package/dist/{schemas → types/schemas}/brillSimple.d.ts +0 -0
- /package/dist/{schemas → types/schemas}/index.d.ts +0 -0
- /package/dist/{schemas → types/schemas}/jss.d.ts +0 -0
- /package/dist/{schemas → types/schemas}/michiganClaremont.d.ts +0 -0
- /package/dist/{schemas → types/schemas}/romaniote.d.ts +0 -0
- /package/dist/{schemas → types/schemas}/sblAcademicSpirantization.d.ts +0 -0
- /package/dist/{schemas → types/schemas}/sblSimple.d.ts +0 -0
- /package/dist/{schemas → types/schemas}/tiberian.d.ts +0 -0
- /package/dist/{sequence.d.ts → types/sequence.d.ts} +0 -0
- /package/dist/{transliterate.d.ts → types/transliterate.d.ts} +0 -0
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var rules_exports = {};
|
|
19
|
+
__export(rules_exports, {
|
|
20
|
+
replaceAndTransliterate: () => replaceAndTransliterate,
|
|
21
|
+
sylRules: () => sylRules,
|
|
22
|
+
wordRules: () => wordRules
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(rules_exports);
|
|
25
|
+
var import_cluster = require("havarotjs/cluster");
|
|
26
|
+
var import_syllable = require("havarotjs/syllable");
|
|
27
|
+
var import_word = require("havarotjs/word");
|
|
28
|
+
var import_regularExpressions = require("havarotjs/utils/regularExpressions");
|
|
29
|
+
var import_hebCharsTrans = require("./hebCharsTrans.js");
|
|
30
|
+
const taamim = /[\u{0590}-\u{05AF}\u{05BD}\u{05BF}]/gu;
|
|
31
|
+
const mapChars = (schema) => (input) => {
|
|
32
|
+
return [...input].map((char) => char in import_hebCharsTrans.transliterateMap ? schema[import_hebCharsTrans.transliterateMap[char]] : char).join("");
|
|
33
|
+
};
|
|
34
|
+
const replaceWithRegex = (input, regex, replaceValue) => input.replace(regex, replaceValue);
|
|
35
|
+
const replaceAndTransliterate = (input, regex, replaceValue, schema) => {
|
|
36
|
+
const sylSeq = replaceWithRegex(input, regex, replaceValue);
|
|
37
|
+
return [...sylSeq].map(mapChars(schema)).join("");
|
|
38
|
+
};
|
|
39
|
+
const isDageshChazaq = (cluster, schema) => {
|
|
40
|
+
var _a, _b, _c, _d, _e, _f;
|
|
41
|
+
if (!schema.DAGESH_CHAZAQ) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
if (cluster.isShureq) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
if (!/\u{05BC}/u.test(cluster.text)) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
const prevWord = (_c = (_b = (_a = cluster.syllable) == null ? void 0 : _a.word) == null ? void 0 : _b.prev) == null ? void 0 : _c.value;
|
|
51
|
+
if (prevWord && (prevWord == null ? void 0 : prevWord.isInConstruct) && !prevWord.syllables[prevWord.syllables.length - 1].isClosed) {
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
const prevSyllable = (_d = cluster.syllable) == null ? void 0 : _d.prev;
|
|
55
|
+
if (!prevSyllable) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
const prevCoda = (_e = prevSyllable.value) == null ? void 0 : _e.codaWithGemination;
|
|
59
|
+
if (!prevCoda) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
return prevCoda === ((_f = cluster.syllable) == null ? void 0 : _f.onset);
|
|
63
|
+
};
|
|
64
|
+
const getDageshChazaqVal = (input, dagesh, isChazaq) => {
|
|
65
|
+
if (!isChazaq) {
|
|
66
|
+
return input;
|
|
67
|
+
}
|
|
68
|
+
if (typeof dagesh === "boolean") {
|
|
69
|
+
return input.repeat(2);
|
|
70
|
+
}
|
|
71
|
+
return input + dagesh;
|
|
72
|
+
};
|
|
73
|
+
const getDivineName = (str, schema) => {
|
|
74
|
+
const begn = str[0];
|
|
75
|
+
const end = str[str.length - 1];
|
|
76
|
+
const divineName = schema.DIVINE_NAME_ELOHIM && /\u{05B4}/u.test(str) ? schema.DIVINE_NAME_ELOHIM : schema.DIVINE_NAME;
|
|
77
|
+
return `${import_regularExpressions.hebChars.test(begn) ? "" : begn}${divineName}${import_regularExpressions.hebChars.test(end) ? "" : end}`;
|
|
78
|
+
};
|
|
79
|
+
const materFeatures = (syl, schema) => {
|
|
80
|
+
const mater = syl.clusters.filter((c) => c.isMater)[0];
|
|
81
|
+
const prev = mater.prev instanceof import_cluster.Cluster ? mater.prev : null;
|
|
82
|
+
const materText = mater.text;
|
|
83
|
+
const prevText = ((prev == null ? void 0 : prev.text) || "").replace(taamim, "");
|
|
84
|
+
let noMaterText = syl.clusters.filter((c) => !c.isMater).map((c) => consonantFeatures(c.text.replace(taamim, ""), syl, c, schema)).join("");
|
|
85
|
+
const hasMaqaf = mater.text.includes("\u05BE");
|
|
86
|
+
noMaterText = hasMaqaf ? noMaterText.concat("\u05BE") : noMaterText;
|
|
87
|
+
if (/י/.test(materText)) {
|
|
88
|
+
if (/\u{05B4}/u.test(prevText)) {
|
|
89
|
+
return replaceWithRegex(noMaterText, /\u{05B4}/u, schema.HIRIQ_YOD);
|
|
90
|
+
}
|
|
91
|
+
if (/\u{05B5}/u.test(prevText)) {
|
|
92
|
+
return replaceWithRegex(noMaterText, /\u{05B5}/u, schema.TSERE_YOD);
|
|
93
|
+
}
|
|
94
|
+
if (/\u{05B6}/u.test(prevText)) {
|
|
95
|
+
return replaceWithRegex(noMaterText, /\u{05B6}/u, schema.SEGOL_YOD);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (/ו/u.test(materText)) {
|
|
99
|
+
if (/\u{05B9}/u.test(prevText)) {
|
|
100
|
+
return replaceWithRegex(noMaterText, /\u{05B9}/u, schema.HOLAM_VAV);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (/ה/.test(materText)) {
|
|
104
|
+
if (/\u{05B8}/u.test(prevText)) {
|
|
105
|
+
return replaceWithRegex(noMaterText, /\u{05B8}/u, schema.QAMATS_HE);
|
|
106
|
+
}
|
|
107
|
+
if (/\u{05B6}/u.test(prevText)) {
|
|
108
|
+
return replaceWithRegex(noMaterText, /\u{05B6}/u, schema.SEGOL_HE);
|
|
109
|
+
}
|
|
110
|
+
if (/\u{05B5}/u.test(prevText)) {
|
|
111
|
+
return replaceWithRegex(noMaterText, /\u{05B5}/u, schema.TSERE_HE);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return materText;
|
|
115
|
+
};
|
|
116
|
+
const joinSyllableChars = (syl, sylChars, schema) => {
|
|
117
|
+
var _a, _b, _c;
|
|
118
|
+
const isInConstruct = (_a = syl.word) == null ? void 0 : _a.isInConstruct;
|
|
119
|
+
if (isInConstruct) {
|
|
120
|
+
return sylChars.map(mapChars(schema)).join("");
|
|
121
|
+
}
|
|
122
|
+
if (!syl.isAccented) {
|
|
123
|
+
return sylChars.map(mapChars(schema)).join("");
|
|
124
|
+
}
|
|
125
|
+
const isOnlyPunctuation = syl.clusters.map((c) => c.isPunctuation).every((c) => c);
|
|
126
|
+
if (isOnlyPunctuation) {
|
|
127
|
+
return sylChars.map(mapChars(schema)).join("");
|
|
128
|
+
}
|
|
129
|
+
if (schema.STRESS_MARKER) {
|
|
130
|
+
const exclude = (_c = (_b = schema.STRESS_MARKER) == null ? void 0 : _b.exclude) != null ? _c : "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
|
+
}
|
|
137
|
+
const location = schema.STRESS_MARKER.location;
|
|
138
|
+
const mark = schema.STRESS_MARKER.mark;
|
|
139
|
+
if (syl.text.includes(mark)) {
|
|
140
|
+
return sylChars.map(mapChars(schema)).join("");
|
|
141
|
+
}
|
|
142
|
+
if (location === "before-syllable") {
|
|
143
|
+
const isDoubled = syl.clusters.map((c) => isDageshChazaq(c, schema)).includes(true);
|
|
144
|
+
if (isDoubled) {
|
|
145
|
+
const chars = sylChars.map(mapChars(schema)).join("");
|
|
146
|
+
const [first, ...rest] = chars;
|
|
147
|
+
return `${first}${mark}${rest.join("")}`;
|
|
148
|
+
}
|
|
149
|
+
return `${mark}${sylChars.map(mapChars(schema)).join("")}`;
|
|
150
|
+
}
|
|
151
|
+
if (location === "after-syllable") {
|
|
152
|
+
return `${sylChars.map(mapChars(schema)).join("")}${mark}`;
|
|
153
|
+
}
|
|
154
|
+
const vowels = [
|
|
155
|
+
schema.PATAH,
|
|
156
|
+
schema.HATAF_PATAH,
|
|
157
|
+
schema.QAMATS,
|
|
158
|
+
schema.HATAF_QAMATS,
|
|
159
|
+
schema.SEGOL,
|
|
160
|
+
schema.HATAF_SEGOL,
|
|
161
|
+
schema.TSERE,
|
|
162
|
+
schema.HIRIQ,
|
|
163
|
+
schema.HOLAM,
|
|
164
|
+
schema.QAMATS_QATAN,
|
|
165
|
+
schema.QUBUTS,
|
|
166
|
+
schema.QAMATS_HE,
|
|
167
|
+
schema.SEGOL_HE,
|
|
168
|
+
schema.TSERE_HE,
|
|
169
|
+
schema.HIRIQ_YOD,
|
|
170
|
+
schema.TSERE_YOD,
|
|
171
|
+
schema.SEGOL_YOD,
|
|
172
|
+
schema.HOLAM_VAV,
|
|
173
|
+
schema.SHUREQ
|
|
174
|
+
].sort((a, b) => b.length - a.length);
|
|
175
|
+
const vowelRgx = new RegExp(`${vowels.join("|")}`);
|
|
176
|
+
const str = sylChars.map(mapChars(schema)).join("");
|
|
177
|
+
const match = str.match(vowelRgx);
|
|
178
|
+
if (location === "before-vowel") {
|
|
179
|
+
return (match == null ? void 0 : match.length) ? str.replace(match[0], `${mark}${match[0]}`) : str;
|
|
180
|
+
}
|
|
181
|
+
return (match == null ? void 0 : match.length) ? str.replace(match[0], `${match[0]}${mark}`) : str;
|
|
182
|
+
}
|
|
183
|
+
return sylChars.map(mapChars(schema)).join("");
|
|
184
|
+
};
|
|
185
|
+
const consonantFeatures = (clusterText, syl, cluster, schema) => {
|
|
186
|
+
var _a, _b;
|
|
187
|
+
if ((_a = schema.ADDITIONAL_FEATURES) == null ? void 0 : _a.length) {
|
|
188
|
+
const seqs = schema.ADDITIONAL_FEATURES;
|
|
189
|
+
for (const seq of seqs) {
|
|
190
|
+
const heb = new RegExp(seq.HEBREW, "u");
|
|
191
|
+
if (seq.FEATURE === "cluster" && heb.test(clusterText)) {
|
|
192
|
+
const transliteration = seq.TRANSLITERATION;
|
|
193
|
+
const passThrough = (_b = seq.PASS_THROUGH) != null ? _b : true;
|
|
194
|
+
if (typeof transliteration === "string") {
|
|
195
|
+
return replaceAndTransliterate(clusterText, heb, transliteration, schema);
|
|
196
|
+
}
|
|
197
|
+
if (!passThrough) {
|
|
198
|
+
return transliteration(cluster, seq.HEBREW, schema);
|
|
199
|
+
}
|
|
200
|
+
clusterText = transliteration(cluster, seq.HEBREW, schema);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
clusterText = cluster.hasSheva && syl.isClosed ? clusterText.replace(/\u{05B0}/u, "") : clusterText;
|
|
205
|
+
if (/ה\u{05BC}$/mu.test(clusterText)) {
|
|
206
|
+
return replaceWithRegex(clusterText, /ה\u{05BC}/u, schema.HE);
|
|
207
|
+
}
|
|
208
|
+
if (syl.isFinal && !syl.isClosed) {
|
|
209
|
+
const furtiveChet = /\u{05D7}\u{05B7}$/mu;
|
|
210
|
+
if (furtiveChet.test(clusterText)) {
|
|
211
|
+
return replaceWithRegex(clusterText, furtiveChet, "\u05B7\u05D7");
|
|
212
|
+
}
|
|
213
|
+
const furtiveAyin = /\u{05E2}\u{05B7}$/mu;
|
|
214
|
+
if (furtiveAyin.test(clusterText)) {
|
|
215
|
+
return replaceWithRegex(clusterText, furtiveAyin, "\u05B7\u05E2");
|
|
216
|
+
}
|
|
217
|
+
const furtiveHe = /\u{05D4}\u{05BC}\u{05B7}$/mu;
|
|
218
|
+
if (furtiveHe.test(clusterText)) {
|
|
219
|
+
return replaceWithRegex(clusterText, furtiveHe, "\u05B7\u05D4\u05BC");
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
const isDageshChazq = isDageshChazaq(cluster, schema);
|
|
223
|
+
if (schema.BET_DAGESH && /ב\u{05BC}/u.test(clusterText)) {
|
|
224
|
+
return replaceWithRegex(clusterText, /ב\u{05BC}/u, getDageshChazaqVal(schema.BET_DAGESH, schema.DAGESH_CHAZAQ, isDageshChazq));
|
|
225
|
+
}
|
|
226
|
+
if (schema.GIMEL_DAGESH && /ג\u{05BC}/u.test(clusterText)) {
|
|
227
|
+
return replaceWithRegex(clusterText, /ג\u{05BC}/u, getDageshChazaqVal(schema.GIMEL_DAGESH, schema.DAGESH_CHAZAQ, isDageshChazq));
|
|
228
|
+
}
|
|
229
|
+
if (schema.DALET_DAGESH && /ד\u{05BC}/u.test(clusterText)) {
|
|
230
|
+
return replaceWithRegex(clusterText, /ד\u{05BC}/u, getDageshChazaqVal(schema.DALET_DAGESH, schema.DAGESH_CHAZAQ, isDageshChazq));
|
|
231
|
+
}
|
|
232
|
+
if (schema.KAF_DAGESH && /כ\u{05BC}/u.test(clusterText)) {
|
|
233
|
+
return replaceWithRegex(clusterText, /כ\u{05BC}/u, getDageshChazaqVal(schema.KAF_DAGESH, schema.DAGESH_CHAZAQ, isDageshChazq));
|
|
234
|
+
}
|
|
235
|
+
if (schema.KAF_DAGESH && /ך\u{05BC}/u.test(clusterText)) {
|
|
236
|
+
return replaceWithRegex(clusterText, /ך\u{05BC}/u, getDageshChazaqVal(schema.KAF_DAGESH, schema.DAGESH_CHAZAQ, isDageshChazq));
|
|
237
|
+
}
|
|
238
|
+
if (schema.PE_DAGESH && /פ\u{05BC}/u.test(clusterText)) {
|
|
239
|
+
return replaceWithRegex(clusterText, /פ\u{05BC}/u, getDageshChazaqVal(schema.PE_DAGESH, schema.DAGESH_CHAZAQ, isDageshChazq));
|
|
240
|
+
}
|
|
241
|
+
if (schema.TAV_DAGESH && /ת\u{05BC}/u.test(clusterText)) {
|
|
242
|
+
return replaceWithRegex(clusterText, /ת\u{05BC}/u, getDageshChazaqVal(schema.TAV_DAGESH, schema.DAGESH_CHAZAQ, isDageshChazq));
|
|
243
|
+
}
|
|
244
|
+
if (/ש\u{05C1}/u.test(clusterText)) {
|
|
245
|
+
return replaceWithRegex(clusterText, /ש\u{05C1}/u, getDageshChazaqVal(schema.SHIN, schema.DAGESH_CHAZAQ, isDageshChazq));
|
|
246
|
+
}
|
|
247
|
+
if (/ש\u{05C2}/u.test(clusterText)) {
|
|
248
|
+
return replaceWithRegex(clusterText, /ש\u{05C2}/u, getDageshChazaqVal(schema.SIN, schema.DAGESH_CHAZAQ, isDageshChazq));
|
|
249
|
+
}
|
|
250
|
+
if (isDageshChazq) {
|
|
251
|
+
const consonant = cluster.chars[0].text;
|
|
252
|
+
const consonantDagesh = new RegExp(consonant + "\u05BC", "u");
|
|
253
|
+
return replaceWithRegex(clusterText, consonantDagesh, getDageshChazaqVal(consonant, schema.DAGESH_CHAZAQ, isDageshChazq));
|
|
254
|
+
}
|
|
255
|
+
if (cluster.isShureq) {
|
|
256
|
+
return clusterText.replace("\u05D5\u05BC", schema.SHUREQ);
|
|
257
|
+
}
|
|
258
|
+
return clusterText;
|
|
259
|
+
};
|
|
260
|
+
const copySyllable = (newText, old) => {
|
|
261
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
262
|
+
const newClusters = newText.split(import_regularExpressions.clusterSplitGroup).map((clusterString) => new import_cluster.Cluster(clusterString, true));
|
|
263
|
+
const oldClusters = old.clusters;
|
|
264
|
+
if (newClusters.length === oldClusters.length) {
|
|
265
|
+
newClusters.forEach((c, i) => {
|
|
266
|
+
var _a2, _b2, _c2, _d2;
|
|
267
|
+
return c.prev = (_b2 = (_a2 = oldClusters[i]) == null ? void 0 : _a2.prev) != null ? _b2 : null, c.next = (_d2 = (_c2 = oldClusters[i]) == null ? void 0 : _c2.next) != null ? _d2 : null;
|
|
268
|
+
});
|
|
269
|
+
} else {
|
|
270
|
+
for (let i = 0; i < newClusters.length; i++) {
|
|
271
|
+
const c = newClusters[i];
|
|
272
|
+
if (((_a = oldClusters[i]) == null ? void 0 : _a.text[0]) === (c == null ? void 0 : c.text[0])) {
|
|
273
|
+
c.prev = (_c = (_b = oldClusters[i]) == null ? void 0 : _b.prev) != null ? _c : null;
|
|
274
|
+
c.next = (_e = (_d = oldClusters[i]) == null ? void 0 : _d.next) != null ? _e : null;
|
|
275
|
+
} else {
|
|
276
|
+
c.prev = (_g = (_f = oldClusters[i]) == null ? void 0 : _f.prev) != null ? _g : null;
|
|
277
|
+
c.next = (_i = (_h = oldClusters[i + 1]) == null ? void 0 : _h.next) != null ? _i : null;
|
|
278
|
+
i++;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
const newSyl = new import_syllable.Syllable(newClusters, {
|
|
283
|
+
isClosed: old.isClosed,
|
|
284
|
+
isAccented: old.isAccented,
|
|
285
|
+
isFinal: old.isFinal
|
|
286
|
+
});
|
|
287
|
+
newClusters.forEach((c) => c.syllable = newSyl);
|
|
288
|
+
newSyl.prev = old.prev;
|
|
289
|
+
newSyl.next = old.next;
|
|
290
|
+
newSyl.word = old.word;
|
|
291
|
+
return newSyl;
|
|
292
|
+
};
|
|
293
|
+
const sylRules = (syl, schema) => {
|
|
294
|
+
var _a, _b;
|
|
295
|
+
const sylTxt = syl.text.replace(taamim, "");
|
|
296
|
+
if ((_a = schema.ADDITIONAL_FEATURES) == null ? void 0 : _a.length) {
|
|
297
|
+
const seqs = schema.ADDITIONAL_FEATURES;
|
|
298
|
+
for (const seq of seqs) {
|
|
299
|
+
const heb = new RegExp(seq.HEBREW, "u");
|
|
300
|
+
if (seq.FEATURE === "syllable" && heb.test(sylTxt)) {
|
|
301
|
+
const transliteration = seq.TRANSLITERATION;
|
|
302
|
+
const passThrough = (_b = seq.PASS_THROUGH) != null ? _b : true;
|
|
303
|
+
if (typeof transliteration === "string") {
|
|
304
|
+
return replaceAndTransliterate(sylTxt, heb, transliteration, schema);
|
|
305
|
+
}
|
|
306
|
+
if (!passThrough) {
|
|
307
|
+
return transliteration(syl, seq.HEBREW, schema);
|
|
308
|
+
}
|
|
309
|
+
const newText = transliteration(syl, seq.HEBREW, schema);
|
|
310
|
+
if (newText !== sylTxt) {
|
|
311
|
+
syl = copySyllable(newText, syl);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
const mSSuffix = /\u{05B8}\u{05D9}\u{05D5}/u;
|
|
317
|
+
if (syl.isFinal && mSSuffix.test(sylTxt)) {
|
|
318
|
+
const sufxSyl = replaceWithRegex(sylTxt, mSSuffix, schema.MS_SUFX);
|
|
319
|
+
return joinSyllableChars(syl, [...sufxSyl], schema);
|
|
320
|
+
}
|
|
321
|
+
const hasMater = syl.clusters.map((c) => c.isMater).includes(true);
|
|
322
|
+
if (hasMater) {
|
|
323
|
+
const materSyl = materFeatures(syl, schema);
|
|
324
|
+
return joinSyllableChars(syl, [...materSyl], schema);
|
|
325
|
+
}
|
|
326
|
+
const returnTxt = syl.clusters.map((cluster) => {
|
|
327
|
+
const clusterText = cluster.text.replace(taamim, "");
|
|
328
|
+
return consonantFeatures(clusterText, syl, cluster, schema);
|
|
329
|
+
});
|
|
330
|
+
return joinSyllableChars(syl, returnTxt, schema).replace(taamim, "");
|
|
331
|
+
};
|
|
332
|
+
const wordRules = (word, schema) => {
|
|
333
|
+
var _a, _b;
|
|
334
|
+
if (word.isDivineName)
|
|
335
|
+
return getDivineName(word.text, schema);
|
|
336
|
+
if (word.hasDivineName)
|
|
337
|
+
return `${sylRules(word.syllables[0], schema)}-${getDivineName(word.text, schema)}`;
|
|
338
|
+
if (word.isNotHebrew)
|
|
339
|
+
return word.text;
|
|
340
|
+
if ((_a = schema.ADDITIONAL_FEATURES) == null ? void 0 : _a.length) {
|
|
341
|
+
const seqs = schema.ADDITIONAL_FEATURES;
|
|
342
|
+
for (const seq of seqs) {
|
|
343
|
+
const heb = new RegExp(seq.HEBREW, "u");
|
|
344
|
+
const text = word.text.replace(taamim, "");
|
|
345
|
+
if (seq.FEATURE === "word" && heb.test(text)) {
|
|
346
|
+
const transliteration = seq.TRANSLITERATION;
|
|
347
|
+
const passThrough = (_b = seq.PASS_THROUGH) != null ? _b : true;
|
|
348
|
+
if (typeof transliteration === "string") {
|
|
349
|
+
return replaceAndTransliterate(text, heb, transliteration, schema);
|
|
350
|
+
}
|
|
351
|
+
if (!passThrough) {
|
|
352
|
+
return transliteration(word, seq.HEBREW, schema);
|
|
353
|
+
}
|
|
354
|
+
return new import_word.Word(transliteration(word, seq.HEBREW, schema), schema);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
return word;
|
|
358
|
+
}
|
|
359
|
+
return word;
|
|
360
|
+
};
|
|
361
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
362
|
+
0 && (module.exports = {
|
|
363
|
+
replaceAndTransliterate,
|
|
364
|
+
sylRules,
|
|
365
|
+
wordRules
|
|
366
|
+
});
|
|
367
|
+
//# sourceMappingURL=rules.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/rules.ts"],
|
|
4
|
+
"sourcesContent": ["import { Cluster } from \"havarotjs/cluster\";\nimport { Syllable } from \"havarotjs/syllable\";\nimport { Word } from \"havarotjs/word\";\nimport { hebChars, clusterSplitGroup } from \"havarotjs/utils/regularExpressions\";\nimport { Schema } from \"./schema\";\nimport { transliterateMap as map } from \"./hebCharsTrans\";\n\nconst taamim = /[\\u{0590}-\\u{05AF}\\u{05BD}\\u{05BF}]/gu;\n\n/**\n * maps Hebrew characters to schema\n *\n * @param input - text to be transliterated\n * @param schema - a {@link Schema} for transliterating the input\n * @returns transliteration of characters\n *\n */\nconst mapChars = (schema: Schema) => (input: string) => {\n return [...input].map((char: string) => (char in map ? schema[map[char]] : char)).join(\"\");\n};\n\n/**\n * a wrapper around String.replace() to constrain to a RegExp\n *\n * @param input the string to be modified\n * @param regex the regex to be used as the search value\n * @param replaceValue the string to replace the regex\n * @returns\n */\nconst replaceWithRegex = (input: string, regex: RegExp, replaceValue: string) => input.replace(regex, replaceValue);\n\n/**\n * replaces part of a string and transliterates the remaining characters according to the schema\n *\n * @example\n * ```ts\n * // replaces \u05D1\u05B8 as VA, but only when matching the regex sequence\n * const betAndQamats = /\\u{05D1}\\u{05B8}/u\n * replaceAndTransliterate(\"\u05D3\u05BC\u05B8\u05D1\u05B8\u05E8\", betAndQamats, \"VA\", schema);\n * // d\u0101VAr\n * ```\n *\n * @param input the text to be transliterated\n * @param regex the regex used as the search value\n * @param replaceValue the string to replace the regex\n * @param schema the Schema\n * @returns\n */\nexport const replaceAndTransliterate = (input: string, regex: RegExp, replaceValue: string, schema: Schema) => {\n const sylSeq = replaceWithRegex(input, regex, replaceValue);\n return [...sylSeq].map(mapChars(schema)).join(\"\");\n};\n\nconst isDageshChazaq = (cluster: Cluster, schema: Schema) => {\n // if there is no dagesh chazaq in the schema, then return false\n if (!schema.DAGESH_CHAZAQ) {\n return false;\n }\n\n // a shureq could potentially match because of dagesh\n if (cluster.isShureq) {\n return false;\n }\n\n // if there is no dagesh in the text, then return false\n if (!/\\u{05BC}/u.test(cluster.text)) {\n return false;\n }\n\n const prevWord = cluster.syllable?.word?.prev?.value;\n if (prevWord && prevWord?.isInConstruct && !prevWord.syllables[prevWord.syllables.length - 1].isClosed) {\n return true;\n }\n\n // this could be a code smell, b/c the copySyllable function results are not the most predictable\n const prevSyllable = cluster.syllable?.prev;\n if (!prevSyllable) {\n return false;\n }\n\n const prevCoda = prevSyllable.value?.codaWithGemination;\n if (!prevCoda) {\n return false;\n }\n\n return prevCoda === cluster.syllable?.onset;\n};\n\nconst getDageshChazaqVal = (input: string, dagesh: Schema[\"DAGESH_CHAZAQ\"], isChazaq: boolean) => {\n if (!isChazaq) {\n return input;\n }\n\n if (typeof dagesh === \"boolean\") {\n return input.repeat(2);\n }\n\n return input + dagesh;\n};\n\n/**\n * formats the Divine Name with any Latin chars\n *\n * @param str word text\n * @param schema\n * @returns the Divine Name with any pre or proceding Latin chars\n */\nconst getDivineName = (str: string, schema: Schema): string => {\n const begn = str[0];\n const end = str[str.length - 1];\n // if DN is pointed with a hiriq, then it is read as 'elohim\n const divineName =\n schema.DIVINE_NAME_ELOHIM && /\\u{05B4}/u.test(str) ? schema.DIVINE_NAME_ELOHIM : schema.DIVINE_NAME;\n return `${hebChars.test(begn) ? \"\" : begn}${divineName}${hebChars.test(end) ? \"\" : end}`;\n};\n\nconst materFeatures = (syl: Syllable, schema: Schema) => {\n const mater = syl.clusters.filter((c) => c.isMater)[0];\n const prev = mater.prev instanceof Cluster ? mater.prev : null;\n const materText = mater.text;\n const prevText = (prev?.text || \"\").replace(taamim, \"\");\n // string comprised of all non-mater clusters in a syl with a mater\n let noMaterText = syl.clusters\n .filter((c) => !c.isMater)\n .map((c) => consonantFeatures(c.text.replace(taamim, \"\"), syl, c, schema))\n .join(\"\");\n\n // workaround for maqaf\n const hasMaqaf = mater.text.includes(\"\u05BE\");\n noMaterText = hasMaqaf ? noMaterText.concat(\"\u05BE\") : noMaterText;\n\n if (/\u05D9/.test(materText)) {\n // hiriq\n if (/\\u{05B4}/u.test(prevText)) {\n return replaceWithRegex(noMaterText, /\\u{05B4}/u, schema.HIRIQ_YOD);\n }\n // tsere\n if (/\\u{05B5}/u.test(prevText)) {\n return replaceWithRegex(noMaterText, /\\u{05B5}/u, schema.TSERE_YOD);\n }\n // segol\n if (/\\u{05B6}/u.test(prevText)) {\n return replaceWithRegex(noMaterText, /\\u{05B6}/u, schema.SEGOL_YOD);\n }\n }\n\n if (/\u05D5/u.test(materText)) {\n // holam\n if (/\\u{05B9}/u.test(prevText)) {\n return replaceWithRegex(noMaterText, /\\u{05B9}/u, schema.HOLAM_VAV);\n }\n }\n\n if (/\u05D4/.test(materText)) {\n // qamets\n if (/\\u{05B8}/u.test(prevText)) {\n return replaceWithRegex(noMaterText, /\\u{05B8}/u, schema.QAMATS_HE);\n }\n\n // seghol\n if (/\\u{05B6}/u.test(prevText)) {\n return replaceWithRegex(noMaterText, /\\u{05B6}/u, schema.SEGOL_HE);\n }\n\n // tsere\n if (/\\u{05B5}/u.test(prevText)) {\n return replaceWithRegex(noMaterText, /\\u{05B5}/u, schema.TSERE_HE);\n }\n }\n\n return materText;\n};\n\nconst joinSyllableChars = (syl: Syllable, sylChars: string[], schema: Schema): string => {\n const isInConstruct = syl.word?.isInConstruct;\n\n if (isInConstruct) {\n return sylChars.map(mapChars(schema)).join(\"\");\n }\n\n if (!syl.isAccented) {\n return sylChars.map(mapChars(schema)).join(\"\");\n }\n\n // if syllable is only punctuation (e.g. a paseq), it should not receive a stress marker\n const isOnlyPunctuation = syl.clusters.map((c) => c.isPunctuation).every((c) => c);\n if (isOnlyPunctuation) {\n return sylChars.map(mapChars(schema)).join(\"\");\n }\n\n if (schema.STRESS_MARKER) {\n const exclude = schema.STRESS_MARKER?.exclude ?? \"never\";\n\n if (exclude === \"single\" && !syl.prev && !syl.next) {\n return sylChars.map(mapChars(schema)).join(\"\");\n }\n\n if (exclude === \"final\" && !syl.next) {\n return sylChars.map(mapChars(schema)).join(\"\");\n }\n\n const location = schema.STRESS_MARKER.location;\n const mark = schema.STRESS_MARKER.mark;\n\n // if the stress marker is already present, no need to add it again\n if (syl.text.includes(mark)) {\n return sylChars.map(mapChars(schema)).join(\"\");\n }\n\n if (location === \"before-syllable\") {\n const isDoubled = syl.clusters.map((c) => isDageshChazaq(c, schema)).includes(true);\n if (isDoubled) {\n const chars = sylChars.map(mapChars(schema)).join(\"\");\n const [first, ...rest] = chars;\n return `${first}${mark}${rest.join(\"\")}`;\n }\n\n return `${mark}${sylChars.map(mapChars(schema)).join(\"\")}`;\n }\n\n if (location === \"after-syllable\") {\n return `${sylChars.map(mapChars(schema)).join(\"\")}${mark}`;\n }\n\n const vowels = [\n schema.PATAH,\n schema.HATAF_PATAH,\n schema.QAMATS,\n schema.HATAF_QAMATS,\n schema.SEGOL,\n schema.HATAF_SEGOL,\n schema.TSERE,\n schema.HIRIQ,\n schema.HOLAM,\n schema.QAMATS_QATAN,\n schema.QUBUTS,\n schema.QAMATS_HE,\n schema.SEGOL_HE,\n schema.TSERE_HE,\n schema.HIRIQ_YOD,\n schema.TSERE_YOD,\n schema.SEGOL_YOD,\n schema.HOLAM_VAV,\n schema.SHUREQ\n ].sort((a, b) => b.length - a.length);\n const vowelRgx = new RegExp(`${vowels.join(\"|\")}`);\n const str = sylChars.map(mapChars(schema)).join(\"\");\n const match = str.match(vowelRgx);\n\n if (location === \"before-vowel\") {\n return match?.length ? str.replace(match[0], `${mark}${match[0]}`) : str;\n }\n\n // after-vowel\n return match?.length ? str.replace(match[0], `${match[0]}${mark}`) : str;\n }\n\n return sylChars.map(mapChars(schema)).join(\"\");\n};\n\nconst consonantFeatures = (clusterText: string, syl: Syllable, cluster: Cluster, schema: Schema) => {\n if (schema.ADDITIONAL_FEATURES?.length) {\n const seqs = schema.ADDITIONAL_FEATURES;\n for (const seq of seqs) {\n const heb = new RegExp(seq.HEBREW, \"u\");\n if (seq.FEATURE === \"cluster\" && heb.test(clusterText)) {\n const transliteration = seq.TRANSLITERATION;\n const passThrough = seq.PASS_THROUGH ?? true;\n if (typeof transliteration === \"string\") {\n return replaceAndTransliterate(clusterText, heb, transliteration, schema);\n }\n if (!passThrough) {\n return transliteration(cluster, seq.HEBREW, schema);\n }\n clusterText = transliteration(cluster, seq.HEBREW, schema);\n }\n }\n }\n\n clusterText = cluster.hasSheva && syl.isClosed ? clusterText.replace(/\\u{05B0}/u, \"\") : clusterText;\n\n // mappiq he\n if (/\u05D4\\u{05BC}$/mu.test(clusterText)) {\n return replaceWithRegex(clusterText, /\u05D4\\u{05BC}/u, schema.HE);\n }\n\n if (syl.isFinal && !syl.isClosed) {\n const furtiveChet = /\\u{05D7}\\u{05B7}$/mu;\n if (furtiveChet.test(clusterText)) {\n return replaceWithRegex(clusterText, furtiveChet, \"\\u{05B7}\\u{05D7}\");\n }\n\n const furtiveAyin = /\\u{05E2}\\u{05B7}$/mu;\n if (furtiveAyin.test(clusterText)) {\n return replaceWithRegex(clusterText, furtiveAyin, \"\\u{05B7}\\u{05E2}\");\n }\n\n const furtiveHe = /\\u{05D4}\\u{05BC}\\u{05B7}$/mu;\n if (furtiveHe.test(clusterText)) {\n return replaceWithRegex(clusterText, furtiveHe, \"\\u{05B7}\\u{05D4}\\u{05BC}\");\n }\n }\n\n // dagesh chazaq\n const isDageshChazq = isDageshChazaq(cluster, schema);\n\n if (schema.BET_DAGESH && /\u05D1\\u{05BC}/u.test(clusterText)) {\n return replaceWithRegex(\n clusterText,\n /\u05D1\\u{05BC}/u,\n getDageshChazaqVal(schema.BET_DAGESH, schema.DAGESH_CHAZAQ, isDageshChazq)\n );\n }\n\n if (schema.GIMEL_DAGESH && /\u05D2\\u{05BC}/u.test(clusterText)) {\n return replaceWithRegex(\n clusterText,\n /\u05D2\\u{05BC}/u,\n getDageshChazaqVal(schema.GIMEL_DAGESH, schema.DAGESH_CHAZAQ, isDageshChazq)\n );\n }\n\n if (schema.DALET_DAGESH && /\u05D3\\u{05BC}/u.test(clusterText)) {\n return replaceWithRegex(\n clusterText,\n /\u05D3\\u{05BC}/u,\n getDageshChazaqVal(schema.DALET_DAGESH, schema.DAGESH_CHAZAQ, isDageshChazq)\n );\n }\n\n if (schema.KAF_DAGESH && /\u05DB\\u{05BC}/u.test(clusterText)) {\n return replaceWithRegex(\n clusterText,\n /\u05DB\\u{05BC}/u,\n getDageshChazaqVal(schema.KAF_DAGESH, schema.DAGESH_CHAZAQ, isDageshChazq)\n );\n }\n\n if (schema.KAF_DAGESH && /\u05DA\\u{05BC}/u.test(clusterText)) {\n return replaceWithRegex(\n clusterText,\n /\u05DA\\u{05BC}/u,\n getDageshChazaqVal(schema.KAF_DAGESH, schema.DAGESH_CHAZAQ, isDageshChazq)\n );\n }\n\n if (schema.PE_DAGESH && /\u05E4\\u{05BC}/u.test(clusterText)) {\n return replaceWithRegex(\n clusterText,\n /\u05E4\\u{05BC}/u,\n getDageshChazaqVal(schema.PE_DAGESH, schema.DAGESH_CHAZAQ, isDageshChazq)\n );\n }\n\n if (schema.TAV_DAGESH && /\u05EA\\u{05BC}/u.test(clusterText)) {\n return replaceWithRegex(\n clusterText,\n /\u05EA\\u{05BC}/u,\n getDageshChazaqVal(schema.TAV_DAGESH, schema.DAGESH_CHAZAQ, isDageshChazq)\n );\n }\n\n if (/\u05E9\\u{05C1}/u.test(clusterText)) {\n return replaceWithRegex(\n clusterText,\n /\u05E9\\u{05C1}/u,\n getDageshChazaqVal(schema.SHIN, schema.DAGESH_CHAZAQ, isDageshChazq)\n );\n }\n\n if (/\u05E9\\u{05C2}/u.test(clusterText)) {\n return replaceWithRegex(\n clusterText,\n /\u05E9\\u{05C2}/u,\n getDageshChazaqVal(schema.SIN, schema.DAGESH_CHAZAQ, isDageshChazq)\n );\n }\n\n if (isDageshChazq) {\n const consonant = cluster.chars[0].text;\n const consonantDagesh = new RegExp(consonant + \"\\u{05BC}\", \"u\");\n return replaceWithRegex(\n clusterText,\n consonantDagesh,\n getDageshChazaqVal(consonant, schema.DAGESH_CHAZAQ, isDageshChazq)\n );\n }\n\n if (cluster.isShureq) {\n return clusterText.replace(\"\u05D5\u05BC\", schema.SHUREQ);\n }\n\n return clusterText;\n};\n\nconst copySyllable = (newText: string, old: Syllable) => {\n const newClusters = newText.split(clusterSplitGroup).map((clusterString) => new Cluster(clusterString, true));\n const oldClusters = old.clusters;\n\n // set prev and next based on old syllable\n if (newClusters.length === oldClusters.length) {\n newClusters.forEach((c, i) => ((c.prev = oldClusters[i]?.prev ?? null), (c.next = oldClusters[i]?.next ?? null)));\n } else {\n for (let i = 0; i < newClusters.length; i++) {\n const c = newClusters[i];\n if (oldClusters[i]?.text[0] === c?.text[0]) {\n c.prev = oldClusters[i]?.prev ?? null;\n c.next = oldClusters[i]?.next ?? null;\n } else {\n c.prev = oldClusters[i]?.prev ?? null;\n c.next = oldClusters[i + 1]?.next ?? null;\n i++;\n }\n }\n }\n\n const newSyl = new Syllable(newClusters, {\n isClosed: old.isClosed,\n isAccented: old.isAccented,\n isFinal: old.isFinal\n });\n\n newClusters.forEach((c) => (c.syllable = newSyl));\n\n newSyl.prev = old.prev;\n newSyl.next = old.next;\n newSyl.word = old.word;\n\n return newSyl;\n};\n\nexport const sylRules = (syl: Syllable, schema: Schema): string => {\n const sylTxt = syl.text.replace(taamim, \"\");\n\n if (schema.ADDITIONAL_FEATURES?.length) {\n const seqs = schema.ADDITIONAL_FEATURES;\n for (const seq of seqs) {\n const heb = new RegExp(seq.HEBREW, \"u\");\n if (seq.FEATURE === \"syllable\" && heb.test(sylTxt)) {\n const transliteration = seq.TRANSLITERATION;\n const passThrough = seq.PASS_THROUGH ?? true;\n\n // if transliteration is a string, then replace\n if (typeof transliteration === \"string\") {\n return replaceAndTransliterate(sylTxt, heb, transliteration, schema);\n }\n\n // if transliteration is a function and passThrough is false, then transliterate and exit\n if (!passThrough) {\n return transliteration(syl, seq.HEBREW, schema);\n }\n\n const newText = transliteration(syl, seq.HEBREW, schema);\n\n // if the transliteration just returns the syllable.text, then no need to copy the syllable\n if (newText !== sylTxt) {\n syl = copySyllable(newText, syl);\n }\n }\n } // end of seqs loop\n }\n\n // syllable is 3ms sufx\n const mSSuffix = /\\u{05B8}\\u{05D9}\\u{05D5}/u;\n if (syl.isFinal && mSSuffix.test(sylTxt)) {\n const sufxSyl = replaceWithRegex(sylTxt, mSSuffix, schema.MS_SUFX);\n return joinSyllableChars(syl, [...sufxSyl], schema);\n }\n\n // syllable has a mater\n const hasMater = syl.clusters.map((c) => c.isMater).includes(true);\n if (hasMater) {\n const materSyl = materFeatures(syl, schema);\n return joinSyllableChars(syl, [...materSyl], schema);\n }\n\n // regular syllables\n const returnTxt = syl.clusters.map((cluster) => {\n const clusterText = cluster.text.replace(taamim, \"\");\n return consonantFeatures(clusterText, syl, cluster, schema);\n });\n\n // there may be taamim still in the text, so remove them\n return joinSyllableChars(syl, returnTxt, schema).replace(taamim, \"\");\n};\n\nexport const wordRules = (word: Word, schema: Schema): string | Word => {\n if (word.isDivineName) return getDivineName(word.text, schema);\n if (word.hasDivineName) return `${sylRules(word.syllables[0], schema)}-${getDivineName(word.text, schema)}`;\n if (word.isNotHebrew) return word.text;\n if (schema.ADDITIONAL_FEATURES?.length) {\n const seqs = schema.ADDITIONAL_FEATURES;\n for (const seq of seqs) {\n const heb = new RegExp(seq.HEBREW, \"u\");\n const text = word.text.replace(taamim, \"\");\n if (seq.FEATURE === \"word\" && heb.test(text)) {\n const transliteration = seq.TRANSLITERATION;\n const passThrough = seq.PASS_THROUGH ?? true;\n if (typeof transliteration === \"string\") {\n return replaceAndTransliterate(text, heb, transliteration, schema);\n }\n if (!passThrough) {\n return transliteration(word, seq.HEBREW, schema);\n }\n return new Word(transliteration(word, seq.HEBREW, schema), schema);\n }\n }\n return word;\n }\n return word;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;;;;;;;qBAAwB;AACxB,sBAAyB;AACzB,kBAAqB;AACrB,gCAA4C;AAE5C,2BAAwC;AAExC,MAAM,SAAS;AAUf,MAAM,WAAW,CAAC,WAAmB,CAAC,UAAiB;AACrD,SAAO,CAAC,GAAG,KAAK,EAAE,IAAI,CAAC,SAAkB,QAAQ,qBAAAA,mBAAM,OAAO,qBAAAA,iBAAI,SAAS,IAAK,EAAE,KAAK,EAAE;AAC3F;AAUA,MAAM,mBAAmB,CAAC,OAAe,OAAe,iBAAyB,MAAM,QAAQ,OAAO,YAAY;AAmB3G,MAAM,0BAA0B,CAAC,OAAe,OAAe,cAAsB,WAAkB;AAC5G,QAAM,SAAS,iBAAiB,OAAO,OAAO,YAAY;AAC1D,SAAO,CAAC,GAAG,MAAM,EAAE,IAAI,SAAS,MAAM,CAAC,EAAE,KAAK,EAAE;AAClD;AAEA,MAAM,iBAAiB,CAAC,SAAkB,WAAkB;AArD5D;AAuDE,MAAI,CAAC,OAAO,eAAe;AACzB,WAAO;EACT;AAGA,MAAI,QAAQ,UAAU;AACpB,WAAO;EACT;AAGA,MAAI,CAAC,YAAY,KAAK,QAAQ,IAAI,GAAG;AACnC,WAAO;EACT;AAEA,QAAM,YAAW,yBAAQ,aAAR,mBAAkB,SAAlB,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IACF;AACA,WAAO;EACT;AACA,SAAO;AACT;",
|
|
6
|
+
"names": ["map", "_a", "_b", "_c", "_d"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var __publicField = (obj, key, value) => {
|
|
20
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
21
|
+
return value;
|
|
22
|
+
};
|
|
23
|
+
var schema_exports = {};
|
|
24
|
+
__export(schema_exports, {
|
|
25
|
+
SBL: () => SBL,
|
|
26
|
+
Schema: () => Schema
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(schema_exports);
|
|
29
|
+
class Schema {
|
|
30
|
+
constructor(schema) {
|
|
31
|
+
__publicField(this, "VOCAL_SHEVA");
|
|
32
|
+
__publicField(this, "HATAF_SEGOL");
|
|
33
|
+
__publicField(this, "HATAF_PATAH");
|
|
34
|
+
__publicField(this, "HATAF_QAMATS");
|
|
35
|
+
__publicField(this, "HIRIQ");
|
|
36
|
+
__publicField(this, "TSERE");
|
|
37
|
+
__publicField(this, "SEGOL");
|
|
38
|
+
__publicField(this, "PATAH");
|
|
39
|
+
__publicField(this, "QAMATS");
|
|
40
|
+
__publicField(this, "HOLAM");
|
|
41
|
+
__publicField(this, "HOLAM_HASER");
|
|
42
|
+
__publicField(this, "QUBUTS");
|
|
43
|
+
__publicField(this, "DAGESH");
|
|
44
|
+
__publicField(this, "DAGESH_CHAZAQ");
|
|
45
|
+
__publicField(this, "MAQAF");
|
|
46
|
+
__publicField(this, "PASEQ");
|
|
47
|
+
__publicField(this, "SOF_PASUQ");
|
|
48
|
+
__publicField(this, "QAMATS_QATAN");
|
|
49
|
+
__publicField(this, "FURTIVE_PATAH");
|
|
50
|
+
__publicField(this, "HIRIQ_YOD");
|
|
51
|
+
__publicField(this, "TSERE_YOD");
|
|
52
|
+
__publicField(this, "SEGOL_YOD");
|
|
53
|
+
__publicField(this, "SHUREQ");
|
|
54
|
+
__publicField(this, "HOLAM_VAV");
|
|
55
|
+
__publicField(this, "QAMATS_HE");
|
|
56
|
+
__publicField(this, "SEGOL_HE");
|
|
57
|
+
__publicField(this, "TSERE_HE");
|
|
58
|
+
__publicField(this, "MS_SUFX");
|
|
59
|
+
__publicField(this, "ALEF");
|
|
60
|
+
__publicField(this, "BET");
|
|
61
|
+
__publicField(this, "BET_DAGESH");
|
|
62
|
+
__publicField(this, "GIMEL");
|
|
63
|
+
__publicField(this, "GIMEL_DAGESH");
|
|
64
|
+
__publicField(this, "DALET");
|
|
65
|
+
__publicField(this, "DALET_DAGESH");
|
|
66
|
+
__publicField(this, "HE");
|
|
67
|
+
__publicField(this, "VAV");
|
|
68
|
+
__publicField(this, "ZAYIN");
|
|
69
|
+
__publicField(this, "HET");
|
|
70
|
+
__publicField(this, "TET");
|
|
71
|
+
__publicField(this, "YOD");
|
|
72
|
+
__publicField(this, "FINAL_KAF");
|
|
73
|
+
__publicField(this, "KAF");
|
|
74
|
+
__publicField(this, "KAF_DAGESH");
|
|
75
|
+
__publicField(this, "LAMED");
|
|
76
|
+
__publicField(this, "FINAL_MEM");
|
|
77
|
+
__publicField(this, "MEM");
|
|
78
|
+
__publicField(this, "FINAL_NUN");
|
|
79
|
+
__publicField(this, "NUN");
|
|
80
|
+
__publicField(this, "SAMEKH");
|
|
81
|
+
__publicField(this, "AYIN");
|
|
82
|
+
__publicField(this, "FINAL_PE");
|
|
83
|
+
__publicField(this, "PE");
|
|
84
|
+
__publicField(this, "PE_DAGESH");
|
|
85
|
+
__publicField(this, "FINAL_TSADI");
|
|
86
|
+
__publicField(this, "TSADI");
|
|
87
|
+
__publicField(this, "QOF");
|
|
88
|
+
__publicField(this, "RESH");
|
|
89
|
+
__publicField(this, "SHIN");
|
|
90
|
+
__publicField(this, "SIN");
|
|
91
|
+
__publicField(this, "TAV");
|
|
92
|
+
__publicField(this, "TAV_DAGESH");
|
|
93
|
+
__publicField(this, "ADDITIONAL_FEATURES");
|
|
94
|
+
__publicField(this, "DIVINE_NAME");
|
|
95
|
+
__publicField(this, "DIVINE_NAME_ELOHIM");
|
|
96
|
+
__publicField(this, "SYLLABLE_SEPARATOR");
|
|
97
|
+
__publicField(this, "STRESS_MARKER");
|
|
98
|
+
__publicField(this, "allowNoNiqqud");
|
|
99
|
+
__publicField(this, "article");
|
|
100
|
+
__publicField(this, "holemHaser");
|
|
101
|
+
__publicField(this, "longVowels");
|
|
102
|
+
__publicField(this, "qametsQatan");
|
|
103
|
+
__publicField(this, "shevaAfterMeteg");
|
|
104
|
+
__publicField(this, "shevaWithMeteg");
|
|
105
|
+
__publicField(this, "sqnmlvy");
|
|
106
|
+
__publicField(this, "strict");
|
|
107
|
+
__publicField(this, "wawShureq");
|
|
108
|
+
this.VOCAL_SHEVA = schema.VOCAL_SHEVA, this.HATAF_SEGOL = schema.HATAF_SEGOL, this.HATAF_PATAH = schema.HATAF_PATAH, this.HATAF_QAMATS = schema.HATAF_QAMATS, this.HIRIQ = schema.HIRIQ, this.TSERE = schema.TSERE, this.SEGOL = schema.SEGOL, this.PATAH = schema.PATAH, this.QAMATS = schema.QAMATS, this.HOLAM = schema.HOLAM, this.HOLAM_HASER = schema.HOLAM_HASER, this.QUBUTS = schema.QUBUTS, this.DAGESH = schema.DAGESH, this.DAGESH_CHAZAQ = schema.DAGESH_CHAZAQ, this.MAQAF = schema.MAQAF, this.PASEQ = schema.PASEQ, this.SOF_PASUQ = schema.SOF_PASUQ, this.QAMATS_QATAN = schema.QAMATS_QATAN, this.FURTIVE_PATAH = schema.FURTIVE_PATAH, this.HIRIQ_YOD = schema.HIRIQ_YOD, this.TSERE_YOD = schema.TSERE_YOD, this.SEGOL_YOD = schema.SEGOL_YOD, this.SHUREQ = schema.SHUREQ, this.HOLAM_VAV = schema.HOLAM_VAV, this.QAMATS_HE = schema.QAMATS_HE, this.SEGOL_HE = schema.SEGOL_HE, this.TSERE_HE = schema.TSERE_HE, this.MS_SUFX = schema.MS_SUFX, this.ALEF = schema.ALEF, this.BET_DAGESH = schema.BET_DAGESH, this.BET = schema.BET, this.GIMEL = schema.GIMEL, this.GIMEL_DAGESH = schema.GIMEL_DAGESH, this.DALET = schema.DALET, this.DALET_DAGESH = schema.DALET_DAGESH, this.HE = schema.HE, this.VAV = schema.VAV, this.ZAYIN = schema.ZAYIN, this.HET = schema.HET, this.TET = schema.TET, this.YOD = schema.YOD, this.FINAL_KAF = schema.FINAL_KAF, this.KAF = schema.KAF, this.KAF_DAGESH = schema.KAF_DAGESH, this.LAMED = schema.LAMED, this.FINAL_MEM = schema.FINAL_MEM, this.MEM = schema.MEM, this.FINAL_NUN = schema.FINAL_NUN, this.NUN = schema.NUN, this.SAMEKH = schema.SAMEKH, this.AYIN = schema.AYIN, this.FINAL_PE = schema.FINAL_PE, this.PE = schema.PE, this.PE_DAGESH = schema.PE_DAGESH, this.FINAL_TSADI = schema.FINAL_TSADI, this.TSADI = schema.TSADI, this.QOF = schema.QOF, this.RESH = schema.RESH, this.SHIN = schema.SHIN, this.SIN = schema.SIN, this.TAV = schema.TAV, this.TAV_DAGESH = schema.TAV_DAGESH, this.DIVINE_NAME = schema.DIVINE_NAME, this.DIVINE_NAME_ELOHIM = schema.DIVINE_NAME_ELOHIM, this.SYLLABLE_SEPARATOR = schema.SYLLABLE_SEPARATOR, this.ADDITIONAL_FEATURES = schema.ADDITIONAL_FEATURES, this.STRESS_MARKER = schema.STRESS_MARKER, this.longVowels = schema.longVowels, this.qametsQatan = schema.qametsQatan, this.sqnmlvy = schema.sqnmlvy, this.shevaAfterMeteg = schema.shevaAfterMeteg, this.shevaWithMeteg = schema.shevaWithMeteg, this.wawShureq = schema.wawShureq, this.article = schema.article, this.allowNoNiqqud = schema.allowNoNiqqud, this.strict = schema.strict, this.holemHaser = schema.holemHaser;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
class SBL extends Schema {
|
|
112
|
+
constructor(schema) {
|
|
113
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va;
|
|
114
|
+
super({
|
|
115
|
+
VOCAL_SHEVA: (_a = schema.VOCAL_SHEVA) != null ? _a : "\u01DD",
|
|
116
|
+
HATAF_SEGOL: (_b = schema.HATAF_SEGOL) != null ? _b : "\u0115",
|
|
117
|
+
HATAF_PATAH: (_c = schema.HATAF_PATAH) != null ? _c : "\u0103",
|
|
118
|
+
HATAF_QAMATS: (_d = schema.HATAF_QAMATS) != null ? _d : "\u014F",
|
|
119
|
+
HIRIQ: (_e = schema.HIRIQ) != null ? _e : "i",
|
|
120
|
+
TSERE: (_f = schema.TSERE) != null ? _f : "\u0113",
|
|
121
|
+
SEGOL: (_g = schema.SEGOL) != null ? _g : "e",
|
|
122
|
+
PATAH: (_h = schema.PATAH) != null ? _h : "a",
|
|
123
|
+
QAMATS: (_i = schema.QAMATS) != null ? _i : "\u0101",
|
|
124
|
+
HOLAM: (_j = schema.HOLAM) != null ? _j : "\u014D",
|
|
125
|
+
HOLAM_HASER: (_k = schema.HOLAM_HASER) != null ? _k : "\u014D",
|
|
126
|
+
QUBUTS: (_l = schema.QUBUTS) != null ? _l : "\u016B",
|
|
127
|
+
DAGESH: (_m = schema.DAGESH) != null ? _m : "",
|
|
128
|
+
DAGESH_CHAZAQ: (_n = schema.DAGESH_CHAZAQ) != null ? _n : true,
|
|
129
|
+
MAQAF: (_o = schema.MAQAF) != null ? _o : "-",
|
|
130
|
+
PASEQ: (_p = schema.PASEQ) != null ? _p : "",
|
|
131
|
+
SOF_PASUQ: (_q = schema.SOF_PASUQ) != null ? _q : "",
|
|
132
|
+
QAMATS_QATAN: (_r = schema.QAMATS_QATAN) != null ? _r : "o",
|
|
133
|
+
FURTIVE_PATAH: (_s = schema.FURTIVE_PATAH) != null ? _s : "a",
|
|
134
|
+
HIRIQ_YOD: (_t = schema.HIRIQ_YOD) != null ? _t : "\xEE",
|
|
135
|
+
TSERE_YOD: (_u = schema.TSERE_YOD) != null ? _u : "\xEA",
|
|
136
|
+
SEGOL_YOD: (_v = schema.SEGOL_YOD) != null ? _v : "\xEA",
|
|
137
|
+
SHUREQ: (_w = schema.SHUREQ) != null ? _w : "\xFB",
|
|
138
|
+
HOLAM_VAV: (_x = schema.HOLAM_VAV) != null ? _x : "\xF4",
|
|
139
|
+
QAMATS_HE: (_y = schema.QAMATS_HE) != null ? _y : "\xE2",
|
|
140
|
+
SEGOL_HE: (_z = schema.SEGOL_HE) != null ? _z : "\xEA",
|
|
141
|
+
TSERE_HE: (_A = schema.TSERE_HE) != null ? _A : "\xEA",
|
|
142
|
+
MS_SUFX: (_B = schema.MS_SUFX) != null ? _B : "\u0101yw",
|
|
143
|
+
ALEF: (_C = schema.ALEF) != null ? _C : "\u02BE",
|
|
144
|
+
BET: (_D = schema.BET) != null ? _D : "b",
|
|
145
|
+
BET_DAGESH: (_E = schema.BET_DAGESH) != null ? _E : void 0,
|
|
146
|
+
GIMEL: (_F = schema.GIMEL) != null ? _F : "g",
|
|
147
|
+
GIMEL_DAGESH: (_G = schema.GIMEL_DAGESH) != null ? _G : void 0,
|
|
148
|
+
DALET: (_H = schema.DALET) != null ? _H : "d",
|
|
149
|
+
DALET_DAGESH: (_I = schema.DALET_DAGESH) != null ? _I : void 0,
|
|
150
|
+
HE: (_J = schema.HE) != null ? _J : "h",
|
|
151
|
+
VAV: (_K = schema.VAV) != null ? _K : "w",
|
|
152
|
+
ZAYIN: (_L = schema.ZAYIN) != null ? _L : "z",
|
|
153
|
+
HET: (_M = schema.HET) != null ? _M : "\u1E25",
|
|
154
|
+
TET: (_N = schema.TET) != null ? _N : "\u1E6D",
|
|
155
|
+
YOD: (_O = schema.YOD) != null ? _O : "y",
|
|
156
|
+
FINAL_KAF: (_P = schema.FINAL_KAF) != null ? _P : "k",
|
|
157
|
+
KAF: (_Q = schema.KAF) != null ? _Q : "k",
|
|
158
|
+
KAF_DAGESH: (_R = schema.KAF_DAGESH) != null ? _R : void 0,
|
|
159
|
+
LAMED: (_S = schema.LAMED) != null ? _S : "l",
|
|
160
|
+
FINAL_MEM: (_T = schema.FINAL_MEM) != null ? _T : "m",
|
|
161
|
+
MEM: (_U = schema.MEM) != null ? _U : "m",
|
|
162
|
+
FINAL_NUN: (_V = schema.FINAL_NUN) != null ? _V : "n",
|
|
163
|
+
NUN: (_W = schema.NUN) != null ? _W : "n",
|
|
164
|
+
SAMEKH: (_X = schema.SAMEKH) != null ? _X : "s",
|
|
165
|
+
AYIN: (_Y = schema.AYIN) != null ? _Y : "\u02BF",
|
|
166
|
+
FINAL_PE: (_Z = schema.FINAL_PE) != null ? _Z : "p",
|
|
167
|
+
PE: (__ = schema.PE) != null ? __ : "p",
|
|
168
|
+
PE_DAGESH: (_$ = schema.PE_DAGESH) != null ? _$ : void 0,
|
|
169
|
+
FINAL_TSADI: (_aa = schema.FINAL_TSADI) != null ? _aa : "\u1E63",
|
|
170
|
+
TSADI: (_ba = schema.TSADI) != null ? _ba : "\u1E63",
|
|
171
|
+
QOF: (_ca = schema.QOF) != null ? _ca : "q",
|
|
172
|
+
RESH: (_da = schema.RESH) != null ? _da : "r",
|
|
173
|
+
SHIN: (_ea = schema.SHIN) != null ? _ea : "\u0161",
|
|
174
|
+
SIN: (_fa = schema.SIN) != null ? _fa : "\u015B",
|
|
175
|
+
TAV: (_ga = schema.TAV) != null ? _ga : "t",
|
|
176
|
+
TAV_DAGESH: (_ha = schema.TAV_DAGESH) != null ? _ha : void 0,
|
|
177
|
+
DIVINE_NAME: (_ia = schema.DIVINE_NAME) != null ? _ia : "yhwh",
|
|
178
|
+
DIVINE_NAME_ELOHIM: (_ja = schema.DIVINE_NAME_ELOHIM) != null ? _ja : void 0,
|
|
179
|
+
SYLLABLE_SEPARATOR: (_ka = schema.SYLLABLE_SEPARATOR) != null ? _ka : void 0,
|
|
180
|
+
ADDITIONAL_FEATURES: (_la = schema.ADDITIONAL_FEATURES) != null ? _la : void 0,
|
|
181
|
+
STRESS_MARKER: (_ma = schema.STRESS_MARKER) != null ? _ma : void 0,
|
|
182
|
+
longVowels: (_na = schema.longVowels) != null ? _na : true,
|
|
183
|
+
qametsQatan: (_oa = schema.qametsQatan) != null ? _oa : true,
|
|
184
|
+
shevaAfterMeteg: (_pa = schema.shevaAfterMeteg) != null ? _pa : true,
|
|
185
|
+
shevaWithMeteg: (_qa = schema.shevaWithMeteg) != null ? _qa : false,
|
|
186
|
+
sqnmlvy: (_ra = schema.sqnmlvy) != null ? _ra : true,
|
|
187
|
+
wawShureq: (_sa = schema.wawShureq) != null ? _sa : true,
|
|
188
|
+
article: (_ta = schema.article) != null ? _ta : true,
|
|
189
|
+
allowNoNiqqud: (_ua = schema.allowNoNiqqud) != null ? _ua : true,
|
|
190
|
+
strict: (_va = schema.strict) != null ? _va : false,
|
|
191
|
+
holemHaser: schema.holemHaser || "remove"
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
196
|
+
0 && (module.exports = {
|
|
197
|
+
SBL,
|
|
198
|
+
Schema
|
|
199
|
+
});
|
|
200
|
+
//# sourceMappingURL=schema.js.map
|