hebrew-transliteration 2.8.4 → 2.9.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/dist/cjs/rules.js CHANGED
@@ -26,7 +26,66 @@ var import_syllable = require("havarotjs/syllable");
26
26
  var import_regularExpressions = require("havarotjs/utils/regularExpressions");
27
27
  var import_word = require("havarotjs/word");
28
28
  var import_hebCharsTrans = require("./hebCharsTrans.js");
29
- const taamim = /[\u{0590}-\u{05AF}\u{05BD}\u{05BF}]/gu;
29
+ const taamim = /[\u{0591}-\u{05AF}\u{05BD}\u{05BF}]/gu;
30
+ const addStressMarker = (text, syl, schema) => {
31
+ var _a, _b;
32
+ if (!schema.STRESS_MARKER || !text) {
33
+ return text;
34
+ }
35
+ if (!syl.isAccented) {
36
+ return text;
37
+ }
38
+ const exclude = (_b = (_a = schema.STRESS_MARKER) == null ? void 0 : _a.exclude) != null ? _b : "never";
39
+ if (exclude === "single" && !syl.prev && !syl.next) {
40
+ return text;
41
+ }
42
+ if (exclude === "final" && !syl.next) {
43
+ return text;
44
+ }
45
+ const location = schema.STRESS_MARKER.location;
46
+ const mark = schema.STRESS_MARKER.mark;
47
+ if (text.includes(mark)) {
48
+ return text;
49
+ }
50
+ if (location === "before-syllable") {
51
+ const isDoubled = syl.clusters.map((c) => isDageshChazaq(c, schema)).includes(true);
52
+ if (isDoubled) {
53
+ const [first, ...rest] = text.split("");
54
+ return `${first}${mark}${rest.join("")}`;
55
+ }
56
+ return `${mark}${text}`;
57
+ }
58
+ if (location === "after-syllable") {
59
+ return `${text}${mark}`;
60
+ }
61
+ const vowels = [
62
+ schema.PATAH,
63
+ schema.HATAF_PATAH,
64
+ schema.QAMATS,
65
+ schema.HATAF_QAMATS,
66
+ schema.SEGOL,
67
+ schema.HATAF_SEGOL,
68
+ schema.TSERE,
69
+ schema.HIRIQ,
70
+ schema.HOLAM,
71
+ schema.QAMATS_QATAN,
72
+ schema.QUBUTS,
73
+ schema.QAMATS_HE,
74
+ schema.SEGOL_HE,
75
+ schema.TSERE_HE,
76
+ schema.HIRIQ_YOD,
77
+ schema.TSERE_YOD,
78
+ schema.SEGOL_YOD,
79
+ schema.HOLAM_VAV,
80
+ schema.SHUREQ
81
+ ].filter((v) => typeof v === "string").sort((a, b) => b.length - a.length);
82
+ const vowelRgx = new RegExp(`${vowels.join("|")}`);
83
+ const match = text.match(vowelRgx);
84
+ if (location === "before-vowel") {
85
+ return (match == null ? void 0 : match.length) ? text.replace(match[0], `${mark}${match[0]}`) : text;
86
+ }
87
+ return (match == null ? void 0 : match.length) ? text.replace(match[0], `${match[0]}${mark}`) : text;
88
+ };
30
89
  const copySyllable = (newText, old) => {
31
90
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
32
91
  const newClusters = newText.split(import_regularExpressions.clusterSplitGroup).map((clusterString) => new import_cluster.Cluster(clusterString, true));
@@ -79,7 +138,7 @@ const getDivineName = (str, schema) => {
79
138
  return `${import_regularExpressions.hebChars.test(begn) ? "" : begn}${divineName}${import_regularExpressions.hebChars.test(end) ? "" : end}`;
80
139
  };
81
140
  const isDageshChazaq = (cluster, schema) => {
82
- var _a, _b, _c, _d, _e, _f;
141
+ var _a, _b, _c, _d, _e, _f, _g;
83
142
  if (!schema.DAGESH_CHAZAQ) {
84
143
  return false;
85
144
  }
@@ -89,22 +148,26 @@ const isDageshChazaq = (cluster, schema) => {
89
148
  if (!/\u{05BC}/u.test(cluster.text)) {
90
149
  return false;
91
150
  }
92
- const prevWord = (_c = (_b = (_a = cluster.syllable) == null ? void 0 : _a.word) == null ? void 0 : _b.prev) == null ? void 0 : _c.value;
151
+ const prevCluster = (_a = cluster.prev) == null ? void 0 : _a.value;
152
+ if (prevCluster && prevCluster.hasSheva) {
153
+ return false;
154
+ }
155
+ const prevWord = (_d = (_c = (_b = cluster.syllable) == null ? void 0 : _b.word) == null ? void 0 : _c.prev) == null ? void 0 : _d.value;
93
156
  if (prevWord && (prevWord == null ? void 0 : prevWord.isInConstruct) && !prevWord.syllables[prevWord.syllables.length - 1].isClosed) {
94
157
  return true;
95
158
  }
96
- const prevSyllable = (_d = cluster.syllable) == null ? void 0 : _d.prev;
159
+ const prevSyllable = (_e = cluster.syllable) == null ? void 0 : _e.prev;
97
160
  if (!prevSyllable) {
98
161
  return false;
99
162
  }
100
- const prevCoda = (_e = prevSyllable.value) == null ? void 0 : _e.codaWithGemination;
163
+ const prevCoda = (_f = prevSyllable.value) == null ? void 0 : _f.codaWithGemination;
101
164
  if (!prevCoda) {
102
165
  return false;
103
166
  }
104
- return prevCoda === ((_f = cluster.syllable) == null ? void 0 : _f.onset);
167
+ return prevCoda === ((_g = cluster.syllable) == null ? void 0 : _g.onset);
105
168
  };
106
169
  const joinSyllableChars = (syl, sylChars, schema) => {
107
- var _a, _b, _c;
170
+ var _a;
108
171
  const isInConstruct = (_a = syl.word) == null ? void 0 : _a.isInConstruct;
109
172
  if (isInConstruct) {
110
173
  return sylChars.map(mapChars(schema)).join("");
@@ -116,60 +179,6 @@ const joinSyllableChars = (syl, sylChars, schema) => {
116
179
  if (isOnlyPunctuation) {
117
180
  return sylChars.map(mapChars(schema)).join("");
118
181
  }
119
- if (schema.STRESS_MARKER) {
120
- const exclude = (_c = (_b = schema.STRESS_MARKER) == null ? void 0 : _b.exclude) != null ? _c : "never";
121
- if (exclude === "single" && !syl.prev && !syl.next) {
122
- return sylChars.map(mapChars(schema)).join("");
123
- }
124
- if (exclude === "final" && !syl.next) {
125
- return sylChars.map(mapChars(schema)).join("");
126
- }
127
- const location = schema.STRESS_MARKER.location;
128
- const mark = schema.STRESS_MARKER.mark;
129
- if (syl.text.includes(mark)) {
130
- return sylChars.map(mapChars(schema)).join("");
131
- }
132
- if (location === "before-syllable") {
133
- const isDoubled = syl.clusters.map((c) => isDageshChazaq(c, schema)).includes(true);
134
- if (isDoubled) {
135
- const chars = sylChars.map(mapChars(schema)).join("");
136
- const [first, ...rest] = chars;
137
- return `${first}${mark}${rest.join("")}`;
138
- }
139
- return `${mark}${sylChars.map(mapChars(schema)).join("")}`;
140
- }
141
- if (location === "after-syllable") {
142
- return `${sylChars.map(mapChars(schema)).join("")}${mark}`;
143
- }
144
- const vowels = [
145
- schema.PATAH,
146
- schema.HATAF_PATAH,
147
- schema.QAMATS,
148
- schema.HATAF_QAMATS,
149
- schema.SEGOL,
150
- schema.HATAF_SEGOL,
151
- schema.TSERE,
152
- schema.HIRIQ,
153
- schema.HOLAM,
154
- schema.QAMATS_QATAN,
155
- schema.QUBUTS,
156
- schema.QAMATS_HE,
157
- schema.SEGOL_HE,
158
- schema.TSERE_HE,
159
- schema.HIRIQ_YOD,
160
- schema.TSERE_YOD,
161
- schema.SEGOL_YOD,
162
- schema.HOLAM_VAV,
163
- schema.SHUREQ
164
- ].filter((v) => typeof v === "string").sort((a, b) => b.length - a.length);
165
- const vowelRgx = new RegExp(`${vowels.join("|")}`);
166
- const str = sylChars.map(mapChars(schema)).join("");
167
- const match = str.match(vowelRgx);
168
- if (location === "before-vowel") {
169
- return (match == null ? void 0 : match.length) ? str.replace(match[0], `${mark}${match[0]}`) : str;
170
- }
171
- return (match == null ? void 0 : match.length) ? str.replace(match[0], `${match[0]}${mark}`) : str;
172
- }
173
182
  return sylChars.map(mapChars(schema)).join("");
174
183
  };
175
184
  const mapChars = (schema) => (input) => {
@@ -291,49 +300,54 @@ const cluterRules = (cluster, schema) => {
291
300
  };
292
301
  const sylRules = (syl, schema) => {
293
302
  var _a, _b;
294
- const sylTxt = syl.text.replace(taamim, "");
303
+ const baseSyllableText = syl.text.replace(taamim, "");
295
304
  const syllableFeatures = (_a = schema.ADDITIONAL_FEATURES) == null ? void 0 : _a.filter((seq) => seq.FEATURE === "syllable");
296
305
  if (syllableFeatures) {
297
306
  for (const feature of syllableFeatures) {
298
307
  const heb = new RegExp(feature.HEBREW, "u");
299
- if (feature.FEATURE === "syllable" && heb.test(sylTxt)) {
308
+ if (feature.FEATURE === "syllable" && heb.test(baseSyllableText)) {
300
309
  const transliteration = feature.TRANSLITERATION;
301
310
  const passThrough = (_b = feature.PASS_THROUGH) != null ? _b : true;
302
311
  if (typeof transliteration === "string") {
303
- return replaceAndTransliterate(sylTxt, heb, transliteration, schema);
312
+ return replaceAndTransliterate(baseSyllableText, heb, transliteration, schema);
304
313
  }
305
314
  if (!passThrough) {
306
315
  return transliteration(syl, feature.HEBREW, schema);
307
316
  }
308
317
  const newText = transliteration(syl, feature.HEBREW, schema);
309
- if (newText !== sylTxt) {
318
+ if (newText !== baseSyllableText) {
310
319
  syl = copySyllable(newText, syl);
311
320
  }
312
321
  }
313
322
  }
314
323
  }
315
- const mSSuffix = /\u{05B8}\u{05D9}\u{05D5}/u;
316
- if (syl.isFinal && mSSuffix.test(sylTxt)) {
317
- const sufxSyl = replaceWithRegex(sylTxt, mSSuffix, schema.MS_SUFX);
318
- return joinSyllableChars(syl, [...sufxSyl], schema);
319
- }
320
324
  const hasMater = syl.clusters.map((c) => c.isMater).includes(true);
321
325
  if (hasMater) {
322
326
  const materSyl = materFeatures(syl, schema);
323
- return joinSyllableChars(syl, [...materSyl], schema);
327
+ const text2 = joinSyllableChars(syl, [...materSyl], schema);
328
+ return addStressMarker(text2, syl, schema);
329
+ }
330
+ const clusters = syl.clusters.map((cluster) => cluterRules(cluster, schema));
331
+ const joined = joinSyllableChars(syl, clusters, schema).replace(taamim, "");
332
+ const mSSuffix = /\u{05B8}\u{05D9}\u{05D5}/u;
333
+ if (syl.isFinal && mSSuffix.test(baseSyllableText)) {
334
+ const text2 = joined.replace(schema["QAMATS"] + schema["YOD"] + schema["VAV"], schema.MS_SUFX);
335
+ return addStressMarker(text2, syl, schema);
336
+ }
337
+ if (schema.SEGOL_HE && /\u{05B6}\u{05D4}/u.test(baseSyllableText)) {
338
+ const text2 = joined.replace(schema["SEGOL"] + schema["HE"], schema.SEGOL_HE);
339
+ return addStressMarker(text2, syl, schema);
324
340
  }
325
- if (schema.SEGOL_HE && /\u{05B6}\u{05D4}/u.test(sylTxt)) {
326
- const returnTxt2 = syl.clusters.map((cluster) => cluterRules(cluster, schema));
327
- const joined = joinSyllableChars(syl, returnTxt2, schema).replace(taamim, "");
328
- return joined.replace(schema["SEGOL"] + schema["HE"], schema.SEGOL_HE);
341
+ if (schema.TSERE_HE && /\u{05B5}\u{05D4}/u.test(baseSyllableText)) {
342
+ const text2 = joined.replace(schema["TSERE"] + schema["HE"], schema.TSERE_HE);
343
+ return addStressMarker(text2, syl, schema);
329
344
  }
330
- if (schema.TSERE_HE && /\u{05B5}\u{05D4}/u.test(sylTxt)) {
331
- const returnTxt2 = syl.clusters.map((cluster) => cluterRules(cluster, schema));
332
- const joined = joinSyllableChars(syl, returnTxt2, schema).replace(taamim, "");
333
- return joined.replace(schema["TSERE"] + schema["HE"], schema.TSERE_HE);
345
+ if (schema.PATAH_HE && /\u{05B7}\u{05D4}/u.test(baseSyllableText)) {
346
+ const text2 = joined.replace(schema["PATAH"] + schema["HE"], schema.PATAH_HE);
347
+ return addStressMarker(text2, syl, schema);
334
348
  }
335
- const returnTxt = syl.clusters.map((cluster) => cluterRules(cluster, schema));
336
- return joinSyllableChars(syl, returnTxt, schema).replace(taamim, "");
349
+ const text = joined.replace(taamim, "");
350
+ return addStressMarker(text, syl, schema);
337
351
  };
338
352
  const wordRules = (word, schema) => {
339
353
  var _a, _b;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/rules.ts"],
4
- "sourcesContent": ["import { Cluster } from \"havarotjs/cluster\";\nimport { Syllable } from \"havarotjs/syllable\";\nimport { clusterSplitGroup, hebChars } from \"havarotjs/utils/regularExpressions\";\nimport { Word } from \"havarotjs/word\";\nimport { transliterateMap as map } from \"./hebCharsTrans\";\nimport { Schema } from \"./schema\";\n\nconst taamim = /[\\u{0590}-\\u{05AF}\\u{05BD}\\u{05BF}]/gu;\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\nconst getDageshChazaqVal = (input: string, schema: Schema, isChazaq: boolean) => {\n if (!isChazaq) {\n return input;\n }\n\n const dagesh = schema[\"DAGESH_CHAZAQ\"];\n const syllableSeparator = schema[\"SYLLABLE_SEPARATOR\"] ?? \"\";\n\n if (typeof dagesh === \"boolean\") {\n return input + syllableSeparator + input;\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 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 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 ]\n .filter((v) => typeof v === \"string\")\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\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\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) => cluterRules(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\n return materText;\n};\n\nconst removeTaamim = (input: string) => input.replace(taamim, \"\");\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 */\nconst 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\n/**\n * 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 */\nconst replaceWithRegex = (input: string, regex: RegExp, replaceValue: string) => input.replace(regex, replaceValue);\n\n// MAIN RULES\n\nconst cluterRules = (cluster: Cluster, schema: Schema) => {\n let clusterText = removeTaamim(cluster.text);\n const clusterFeatures = schema.ADDITIONAL_FEATURES?.filter((seq) => seq.FEATURE === \"cluster\");\n if (clusterFeatures) {\n for (const feature of clusterFeatures) {\n const heb = new RegExp(feature.HEBREW, \"u\");\n if (feature.FEATURE === \"cluster\" && heb.test(clusterText)) {\n const transliteration = feature.TRANSLITERATION;\n const passThrough = feature.PASS_THROUGH ?? true;\n\n if (typeof transliteration === \"string\") {\n return replaceAndTransliterate(clusterText, heb, transliteration, schema);\n }\n\n if (!passThrough) {\n return transliteration(cluster, feature.HEBREW, schema);\n }\n\n clusterText = transliteration(cluster, feature.HEBREW, schema);\n }\n }\n }\n\n const syl = cluster.syllable;\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(clusterText, /\u05D1\\u{05BC}/u, getDageshChazaqVal(schema.BET_DAGESH, schema, isDageshChazq));\n }\n\n if (schema.GIMEL_DAGESH && /\u05D2\\u{05BC}/u.test(clusterText)) {\n return replaceWithRegex(clusterText, /\u05D2\\u{05BC}/u, getDageshChazaqVal(schema.GIMEL_DAGESH, schema, isDageshChazq));\n }\n\n if (schema.DALET_DAGESH && /\u05D3\\u{05BC}/u.test(clusterText)) {\n return replaceWithRegex(clusterText, /\u05D3\\u{05BC}/u, getDageshChazaqVal(schema.DALET_DAGESH, schema, isDageshChazq));\n }\n\n if (schema.KAF_DAGESH && /\u05DB\\u{05BC}/u.test(clusterText)) {\n return replaceWithRegex(clusterText, /\u05DB\\u{05BC}/u, getDageshChazaqVal(schema.KAF_DAGESH, schema, isDageshChazq));\n }\n\n if (schema.KAF_DAGESH && /\u05DA\\u{05BC}/u.test(clusterText)) {\n return replaceWithRegex(clusterText, /\u05DA\\u{05BC}/u, getDageshChazaqVal(schema.KAF_DAGESH, schema, isDageshChazq));\n }\n\n if (schema.PE_DAGESH && /\u05E4\\u{05BC}/u.test(clusterText)) {\n return replaceWithRegex(clusterText, /\u05E4\\u{05BC}/u, getDageshChazaqVal(schema.PE_DAGESH, schema, isDageshChazq));\n }\n\n if (schema.TAV_DAGESH && /\u05EA\\u{05BC}/u.test(clusterText)) {\n return replaceWithRegex(clusterText, /\u05EA\\u{05BC}/u, getDageshChazaqVal(schema.TAV_DAGESH, schema, isDageshChazq));\n }\n\n if (/\u05E9\\u{05C1}/u.test(clusterText)) {\n return replaceWithRegex(clusterText, /\u05E9\\u{05C1}/u, getDageshChazaqVal(schema.SHIN, schema, isDageshChazq));\n }\n\n if (/\u05E9\\u{05C2}/u.test(clusterText)) {\n return replaceWithRegex(clusterText, /\u05E9\\u{05C2}/u, getDageshChazaqVal(schema.SIN, schema, isDageshChazq));\n }\n\n if (isDageshChazq) {\n const consonant = cluster.chars[0].text;\n const consonantDagesh = new RegExp(consonant + \"\\u{05BC}\", \"u\");\n return replaceWithRegex(clusterText, consonantDagesh, getDageshChazaqVal(consonant, schema, isDageshChazq));\n }\n\n if (cluster.isShureq) {\n return clusterText.replace(\"\u05D5\u05BC\", schema.SHUREQ);\n }\n\n return clusterText;\n};\n\nexport const sylRules = (syl: Syllable, schema: Schema): string => {\n const sylTxt = syl.text.replace(taamim, \"\");\n\n const syllableFeatures = schema.ADDITIONAL_FEATURES?.filter((seq) => seq.FEATURE === \"syllable\");\n if (syllableFeatures) {\n for (const feature of syllableFeatures) {\n const heb = new RegExp(feature.HEBREW, \"u\");\n if (feature.FEATURE === \"syllable\" && heb.test(sylTxt)) {\n const transliteration = feature.TRANSLITERATION;\n const passThrough = feature.PASS_THROUGH ?? true;\n\n if (typeof transliteration === \"string\") {\n return replaceAndTransliterate(sylTxt, heb, transliteration, schema);\n }\n\n if (!passThrough) {\n return transliteration(syl, feature.HEBREW, schema);\n }\n\n const newText = transliteration(syl, feature.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 }\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 if (schema.SEGOL_HE && /\\u{05B6}\\u{05D4}/u.test(sylTxt)) {\n const returnTxt = syl.clusters.map((cluster) => cluterRules(cluster, schema));\n const joined = joinSyllableChars(syl, returnTxt, schema).replace(taamim, \"\");\n return joined.replace(schema[\"SEGOL\"] + schema[\"HE\"], schema.SEGOL_HE);\n }\n\n // tsere\n if (schema.TSERE_HE && /\\u{05B5}\\u{05D4}/u.test(sylTxt)) {\n const returnTxt = syl.clusters.map((cluster) => cluterRules(cluster, schema));\n const joined = joinSyllableChars(syl, returnTxt, schema).replace(taamim, \"\");\n return joined.replace(schema[\"TSERE\"] + schema[\"HE\"], schema.TSERE_HE);\n }\n\n // regular syllables\n const returnTxt = syl.clusters.map((cluster) => cluterRules(cluster, schema));\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) {\n return getDivineName(word.text, schema);\n }\n\n if (word.hasDivineName) {\n return `${sylRules(word.syllables[0], schema)}-${getDivineName(word.text, schema)}`;\n }\n\n if (word.isNotHebrew) {\n return word.text;\n }\n\n const wordFeatures = schema.ADDITIONAL_FEATURES?.filter((seq) => seq.FEATURE === \"word\");\n if (wordFeatures) {\n const text = word.text.replace(taamim, \"\");\n for (const feature of wordFeatures) {\n const heb = new RegExp(feature.HEBREW, \"u\");\n if (heb.test(text)) {\n const transliteration = feature.TRANSLITERATION;\n const passThrough = feature.PASS_THROUGH ?? true;\n\n if (typeof transliteration === \"string\") {\n return replaceAndTransliterate(text, heb, transliteration, schema);\n }\n\n if (!passThrough) {\n return transliteration(word, feature.HEBREW, schema);\n }\n\n return new Word(transliteration(word, feature.HEBREW, schema), schema);\n }\n }\n return word;\n }\n\n return word;\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;;;;;;qBAAwB;AACxB,sBAAyB;AACzB,gCAA4C;AAC5C,kBAAqB;AACrB,2BAAwC;AAGxC,MAAM,SAAS;AAEf,MAAM,eAAe,CAAC,SAAiB,QAAiB;AATxD;AAUE,QAAM,cAAc,QAAQ,MAAM,2CAAiB,EAAE,IAAI,CAAC,kBAAkB,IAAI,uBAAQ,eAAe,IAAI,CAAC;AAC5G,QAAM,cAAc,IAAI;AAGxB,MAAI,YAAY,WAAW,YAAY,QAAQ;AAC7C,gBAAY,QAAQ,CAAC,GAAG,MAAG;AAf/B,UAAAA,KAAAC,KAAAC,KAAAC;AAeoC,eAAE,QAAOF,OAAAD,MAAA,YAAY,OAA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AY,YAAY,SAAS,MAAM,CAAC;AAG5E,SAAO,kBAAkB,KAAK,WAAW,MAAM,EAAE,QAAQ,QAAQ,EAAE;AACrE;AAEO,MAAM,YAAY,CAAC,MAAY,WAAiC;AAxcvE;AAycE,MAAI,KAAK,cAAc;AACrB,WAAO,cAAc,KAAK,MAAM,MAAM;EACxC;AAEA,MAAI,KAAK,eAAe;AACtB,WAAO,GAAG,SAAS,KAAK,UAAU,IAAI,MAAM,KAAK,cAAc,KAAK,MAAM,MAAM;EAClF;AAEA,MAAI,KAAK,aAAa;AACpB,WAAO,KAAK;EACd;AAEA,QAAM,gBAAe,YAAO,wBAAP,mBAA4B,OAAO,CAAC,QAAQ,IAAI,YAAY;AACjF,MAAI,cAAc;AAChB,UAAM,OAAO,KAAK,KAAK,QAAQ,QAAQ,EAAE;AACzC,eAAW,WAAW,cAAc;AAClC,YAAM,MAAM,IAAI,OAAO,QAAQ,QAAQ,GAAG;AAC1C,UAAI,IAAI,KAAK,IAAI,GAAG;AAClB,cAAM,kBAAkB,QAAQ;AAChC,cAAM,eAAc,aAAQ,iBAAR,YAAwB;AAE5C,YAAI,OAAO,oBAAoB,UAAU;AACvC,iBAAO,wBAAwB,MAAM,KAAK,iBAAiB,MAAM;QACnE;AAEA,YAAI,CAAC,aAAa;AAChB,iBAAO,gBAAgB,MAAM,QAAQ,QAAQ,MAAM;QACrD;AAEA,eAAO,IAAI,iBAAK,gBAAgB,MAAM,QAAQ,QAAQ,MAAM,GAAG,MAAM;MACvE;IACF;AACA,WAAO;EACT;AAEA,SAAO;AACT;",
6
- "names": ["_a", "_b", "_c", "_d", "map", "returnTxt"]
4
+ "sourcesContent": ["import { Cluster } from \"havarotjs/cluster\";\nimport { Syllable } from \"havarotjs/syllable\";\nimport { clusterSplitGroup, hebChars } from \"havarotjs/utils/regularExpressions\";\nimport { Word } from \"havarotjs/word\";\nimport { transliterateMap as map } from \"./hebCharsTrans\";\nimport { Schema } from \"./schema\";\n\nconst taamim = /[\\u{0591}-\\u{05AF}\\u{05BD}\\u{05BF}]/gu;\n\n/**\n * Adds a stress marker to a syllable according to the schema settings\n *\n * @param text the transliterated text\n * @param syl the current syllable\n * @param schema the schema\n */\nconst addStressMarker = (text: string, syl: Syllable, schema: Schema) => {\n if (!schema.STRESS_MARKER || !text) {\n return text;\n }\n\n if (!syl.isAccented) {\n return text;\n }\n\n const exclude = schema.STRESS_MARKER?.exclude ?? \"never\";\n\n if (exclude === \"single\" && !syl.prev && !syl.next) {\n return text;\n }\n\n if (exclude === \"final\" && !syl.next) {\n return text;\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 (text.includes(mark)) {\n return text;\n }\n\n if (location === \"before-syllable\") {\n const isDoubled = syl.clusters.map((c) => isDageshChazaq(c, schema)).includes(true);\n if (isDoubled) {\n const [first, ...rest] = text.split(\"\");\n return `${first}${mark}${rest.join(\"\")}`;\n }\n\n return `${mark}${text}`;\n }\n\n if (location === \"after-syllable\") {\n return `${text}${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 ]\n .filter((v) => typeof v === \"string\")\n .sort((a, b) => b.length - a.length);\n const vowelRgx = new RegExp(`${vowels.join(\"|\")}`);\n const match = text.match(vowelRgx);\n\n if (location === \"before-vowel\") {\n return match?.length ? text.replace(match[0], `${mark}${match[0]}`) : text;\n }\n\n // after-vowel\n return match?.length ? text.replace(match[0], `${match[0]}${mark}`) : text;\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\nconst getDageshChazaqVal = (input: string, schema: Schema, isChazaq: boolean) => {\n if (!isChazaq) {\n return input;\n }\n\n const dagesh = schema[\"DAGESH_CHAZAQ\"];\n const syllableSeparator = schema[\"SYLLABLE_SEPARATOR\"] ?? \"\";\n\n if (typeof dagesh === \"boolean\") {\n return input + syllableSeparator + input;\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 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 // if the previous cluster has a sheva, then it is not a dagesh chazaq\n // likely being a Qal 2fs suffix (e.g. \u05E7\u05B8\u05D8\u05B7\u05DC\u05B0\u05EA\u05BC\u05B0)\n const prevCluster = cluster.prev?.value;\n if (prevCluster && prevCluster.hasSheva) {\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 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 return sylChars.map(mapChars(schema)).join(\"\");\n};\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\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) => cluterRules(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\n return materText;\n};\n\nconst removeTaamim = (input: string) => input.replace(taamim, \"\");\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 */\nconst 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\n/**\n * 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 */\nconst replaceWithRegex = (input: string, regex: RegExp, replaceValue: string) => input.replace(regex, replaceValue);\n\n// MAIN RULES\n\nconst cluterRules = (cluster: Cluster, schema: Schema) => {\n let clusterText = removeTaamim(cluster.text);\n const clusterFeatures = schema.ADDITIONAL_FEATURES?.filter((seq) => seq.FEATURE === \"cluster\");\n if (clusterFeatures) {\n for (const feature of clusterFeatures) {\n const heb = new RegExp(feature.HEBREW, \"u\");\n if (feature.FEATURE === \"cluster\" && heb.test(clusterText)) {\n const transliteration = feature.TRANSLITERATION;\n const passThrough = feature.PASS_THROUGH ?? true;\n\n if (typeof transliteration === \"string\") {\n return replaceAndTransliterate(clusterText, heb, transliteration, schema);\n }\n\n if (!passThrough) {\n return transliteration(cluster, feature.HEBREW, schema);\n }\n\n clusterText = transliteration(cluster, feature.HEBREW, schema);\n }\n }\n }\n\n const syl = cluster.syllable;\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(clusterText, /\u05D1\\u{05BC}/u, getDageshChazaqVal(schema.BET_DAGESH, schema, isDageshChazq));\n }\n\n if (schema.GIMEL_DAGESH && /\u05D2\\u{05BC}/u.test(clusterText)) {\n return replaceWithRegex(clusterText, /\u05D2\\u{05BC}/u, getDageshChazaqVal(schema.GIMEL_DAGESH, schema, isDageshChazq));\n }\n\n if (schema.DALET_DAGESH && /\u05D3\\u{05BC}/u.test(clusterText)) {\n return replaceWithRegex(clusterText, /\u05D3\\u{05BC}/u, getDageshChazaqVal(schema.DALET_DAGESH, schema, isDageshChazq));\n }\n\n if (schema.KAF_DAGESH && /\u05DB\\u{05BC}/u.test(clusterText)) {\n return replaceWithRegex(clusterText, /\u05DB\\u{05BC}/u, getDageshChazaqVal(schema.KAF_DAGESH, schema, isDageshChazq));\n }\n\n if (schema.KAF_DAGESH && /\u05DA\\u{05BC}/u.test(clusterText)) {\n return replaceWithRegex(clusterText, /\u05DA\\u{05BC}/u, getDageshChazaqVal(schema.KAF_DAGESH, schema, isDageshChazq));\n }\n\n if (schema.PE_DAGESH && /\u05E4\\u{05BC}/u.test(clusterText)) {\n return replaceWithRegex(clusterText, /\u05E4\\u{05BC}/u, getDageshChazaqVal(schema.PE_DAGESH, schema, isDageshChazq));\n }\n\n if (schema.TAV_DAGESH && /\u05EA\\u{05BC}/u.test(clusterText)) {\n return replaceWithRegex(clusterText, /\u05EA\\u{05BC}/u, getDageshChazaqVal(schema.TAV_DAGESH, schema, isDageshChazq));\n }\n\n if (/\u05E9\\u{05C1}/u.test(clusterText)) {\n return replaceWithRegex(clusterText, /\u05E9\\u{05C1}/u, getDageshChazaqVal(schema.SHIN, schema, isDageshChazq));\n }\n\n if (/\u05E9\\u{05C2}/u.test(clusterText)) {\n return replaceWithRegex(clusterText, /\u05E9\\u{05C2}/u, getDageshChazaqVal(schema.SIN, schema, isDageshChazq));\n }\n\n if (isDageshChazq) {\n const consonant = cluster.chars[0].text;\n const consonantDagesh = new RegExp(consonant + \"\\u{05BC}\", \"u\");\n return replaceWithRegex(clusterText, consonantDagesh, getDageshChazaqVal(consonant, schema, isDageshChazq));\n }\n\n if (cluster.isShureq) {\n return clusterText.replace(\"\u05D5\u05BC\", schema.SHUREQ);\n }\n\n return clusterText;\n};\n\nexport const sylRules = (syl: Syllable, schema: Schema): string => {\n /** The syllable's original text with taamim removed */\n const baseSyllableText = syl.text.replace(taamim, \"\");\n\n const syllableFeatures = schema.ADDITIONAL_FEATURES?.filter((seq) => seq.FEATURE === \"syllable\");\n if (syllableFeatures) {\n for (const feature of syllableFeatures) {\n const heb = new RegExp(feature.HEBREW, \"u\");\n if (feature.FEATURE === \"syllable\" && heb.test(baseSyllableText)) {\n const transliteration = feature.TRANSLITERATION;\n const passThrough = feature.PASS_THROUGH ?? true;\n\n if (typeof transliteration === \"string\") {\n return replaceAndTransliterate(baseSyllableText, heb, transliteration, schema);\n }\n\n if (!passThrough) {\n return transliteration(syl, feature.HEBREW, schema);\n }\n\n const newText = transliteration(syl, feature.HEBREW, schema);\n\n // if the transliteration just returns the syllable.text, then no need to copy the syllable\n if (newText !== baseSyllableText) {\n syl = copySyllable(newText, syl);\n }\n }\n }\n }\n\n const hasMater = syl.clusters.map((c) => c.isMater).includes(true);\n if (hasMater) {\n const materSyl = materFeatures(syl, schema);\n const text = joinSyllableChars(syl, [...materSyl], schema);\n return addStressMarker(text, syl, schema);\n }\n\n const clusters = syl.clusters.map((cluster) => cluterRules(cluster, schema));\n const joined = joinSyllableChars(syl, clusters, schema).replace(taamim, \"\");\n\n // syllable is 3ms sufx\n const mSSuffix = /\\u{05B8}\\u{05D9}\\u{05D5}/u;\n if (syl.isFinal && mSSuffix.test(baseSyllableText)) {\n const text = joined.replace(schema[\"QAMATS\"] + schema[\"YOD\"] + schema[\"VAV\"], schema.MS_SUFX);\n return addStressMarker(text, syl, schema);\n }\n\n if (schema.SEGOL_HE && /\\u{05B6}\\u{05D4}/u.test(baseSyllableText)) {\n const text = joined.replace(schema[\"SEGOL\"] + schema[\"HE\"], schema.SEGOL_HE);\n return addStressMarker(text, syl, schema);\n }\n\n if (schema.TSERE_HE && /\\u{05B5}\\u{05D4}/u.test(baseSyllableText)) {\n const text = joined.replace(schema[\"TSERE\"] + schema[\"HE\"], schema.TSERE_HE);\n return addStressMarker(text, syl, schema);\n }\n\n if (schema.PATAH_HE && /\\u{05B7}\\u{05D4}/u.test(baseSyllableText)) {\n const text = joined.replace(schema[\"PATAH\"] + schema[\"HE\"], schema.PATAH_HE);\n return addStressMarker(text, syl, schema);\n }\n\n const text = joined.replace(taamim, \"\");\n return addStressMarker(text, syl, schema);\n};\n\nexport const wordRules = (word: Word, schema: Schema): string | Word => {\n if (word.isDivineName) {\n return getDivineName(word.text, schema);\n }\n\n if (word.hasDivineName) {\n return `${sylRules(word.syllables[0], schema)}-${getDivineName(word.text, schema)}`;\n }\n\n if (word.isNotHebrew) {\n return word.text;\n }\n\n const wordFeatures = schema.ADDITIONAL_FEATURES?.filter((seq) => seq.FEATURE === \"word\");\n if (wordFeatures) {\n const text = word.text.replace(taamim, \"\");\n for (const feature of wordFeatures) {\n const heb = new RegExp(feature.HEBREW, \"u\");\n if (heb.test(text)) {\n const transliteration = feature.TRANSLITERATION;\n const passThrough = feature.PASS_THROUGH ?? true;\n\n if (typeof transliteration === \"string\") {\n return replaceAndTransliterate(text, heb, transliteration, schema);\n }\n\n if (!passThrough) {\n return transliteration(word, feature.HEBREW, schema);\n }\n\n return new Word(transliteration(word, feature.HEBREW, schema), schema);\n }\n }\n return word;\n }\n\n return word;\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;;;;;;qBAAwB;AACxB,sBAAyB;AACzB,gCAA4C;AAC5C,kBA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