hebrew-transliteration
Version:
a package for transliterating Hebrew
187 lines (186 loc) • 5.54 kB
JavaScript
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var romaniote_exports = {};
__export(romaniote_exports, {
romaniote: () => romaniote
});
module.exports = __toCommonJS(romaniote_exports);
const romaniote = {
ALEF: "",
BET: "\u03B2",
BET_DAGESH: "\u03BC\u03C0",
GIMEL: "\u03B3",
GIMEL_DAGESH: "\u03B3\u03BA",
DALET: "\u03B4",
DALET_DAGESH: "\u03BD\u03C4",
HE: "",
VAV: "\u03B2",
ZAYIN: "\u03B6",
HET: "\u03C7",
TET: "\u03C4",
YOD: "\u03B3\u03B9",
KAF: "\u03C7",
KAF_DAGESH: "\u03BA",
FINAL_KAF: "\u03C7",
LAMED: "\u03BB",
MEM: "\u03BC",
FINAL_MEM: "\u03BC",
NUN: "\u03BD",
FINAL_NUN: "\u03BD",
SAMEKH: "\u03C3",
AYIN: "",
PE: "\u03C6",
PE_DAGESH: "\u03C0",
FINAL_PE: "\u03C6",
TSADI: "\u03C4\u03C3",
FINAL_TSADI: "\u03C4\u03C2",
QOF: "\u03BA",
RESH: "\u03C1",
SIN: "\u03C3",
SHIN: "\u03C3\u03C3",
TAV: "\u03B8",
TAV_DAGESH: "\u03C4",
DAGESH: "",
DAGESH_CHAZAQ: false,
VOCAL_SHEVA: "\u03B5",
PATAH: "\u03B1",
HATAF_PATAH: "\u03B1",
QAMATS: "\u03B1",
HATAF_QAMATS: "\u03BF",
SEGOL: "\u03B5",
HATAF_SEGOL: "\u03B5",
TSERE: "\u03B5",
HIRIQ: "\u03B9",
HOLAM: "\u03C9",
HOLAM_HASER: "\u03C9",
QUBUTS: "\u03BF\u03C5",
QAMATS_HE: "\u03B1",
SEGOL_HE: "\u03B5",
TSERE_HE: "\u03B5",
SEGOL_YOD: "\u03B5",
HIRIQ_YOD: "\u03B9",
TSERE_YOD: "\u03B5",
FURTIVE_PATAH: "a",
QAMATS_QATAN: "\u03BF",
HOLAM_VAV: "\u03C9",
SHUREQ: "\u03BF\u03C5",
MS_SUFX: "\u03AC\u03B2",
PASEQ: "",
SOF_PASUQ: "",
MAQAF: "-",
DIVINE_NAME: "\u0391\u03B4\u03C9\u03BD\u03AC\u03B7",
ADDITIONAL_FEATURES: [
{
FEATURE: "cluster",
HEBREW: "\u05D6\u05BC",
TRANSLITERATION: "\u03C4\u03B6"
},
{
FEATURE: "cluster",
HEBREW: /(\u{05E9}\u{05C2}|\u{05E9}|\u{05E1})$/u,
TRANSLITERATION: "\u03C2"
},
{
FEATURE: "syllable",
HEBREW: /\u{05E9}\u{05C1}$/u,
TRANSLITERATION: (syllable, hebrew) => {
if (syllable.isFinal) {
return syllable.text.replace(hebrew, "\u03C3\u03C2");
}
return syllable.text;
}
},
{
FEATURE: "syllable",
HEBREW: /(?<patachYod>[\u{05B7}\u{05B8}][\u{0591}-\u{05AF}\u{05BD}\u{05BF}]?\u{05D9}[\u{0590}-\u{05AF}\u{05BD}\u{05BF}]?)(?!\u{05D5})(?<maqqaf>\u{05BE}?)/u,
TRANSLITERATION: (syllable, hebrew) => {
const match = syllable.text.match(hebrew);
const groups = match == null ? void 0 : match.groups;
if (!groups) {
return syllable.text;
}
const { patachYod } = groups;
return syllable.text.replace(patachYod, "\u03B1\u03B7");
}
},
{
FEATURE: "cluster",
HEBREW: /(\u{05D9}\u{05B4})/u,
TRANSLITERATION: "\u03B3\u03B9"
},
{
FEATURE: "syllable",
HEBREW: /(?<tsereYod>\u{05B5}[\u{0590}-\u{05AF}\u{05BD}\u{05BF}]?\u{05D9}[\u{0590}-\u{05AF}\u{05BD}\u{05BF}]?)(?<maqqaf>\u{05BE}?)$/u,
TRANSLITERATION: (syllable, hebrew) => {
const match = syllable.text.match(hebrew);
const groups = match == null ? void 0 : match.groups;
if (!groups) {
return syllable.text;
}
const { tsereYod } = groups;
if (syllable.isFinal) {
return syllable.text.replace(tsereYod, "\u03B1\u03B9\u0301");
}
return syllable.text.replace(tsereYod, "\u03B5");
}
},
{
FEATURE: "syllable",
HEBREW: /(?<hiriqYod>\u{05B4}[\u{0590}-\u{05AF}\u{05BD}\u{05BF}]?\u{05D9}[\u{0590}-\u{05AF}\u{05BD}\u{05BF}]?)(?<maqqaf>\u{05BE}?)$/u,
TRANSLITERATION: (syllable, hebrew) => {
const match = syllable.text.match(hebrew);
const groups = match == null ? void 0 : match.groups;
if (!groups) {
return syllable.text;
}
const { hiriqYod } = groups;
if (syllable.isFinal) {
const finalHiriqYod = syllable.isAccented ? "\u03AE" : "\u03B7";
return syllable.text.replace(hiriqYod, finalHiriqYod);
}
return syllable.isAccented ? syllable.text.replace(hiriqYod, "\u03AF") : syllable.text.replace(hiriqYod, "\u03B9");
}
},
{
FEATURE: "syllable",
HEBREW: /(\u{05B4}[\u{0590}-\u{05AF}\u{05BD}\u{05BF}]?\u{05D9}\u{05DD})/u,
TRANSLITERATION: (syllable, hebrew) => {
return syllable.text.replace(hebrew, "\u03B5\u03B9\u0301\u03BC");
}
}
],
STRESS_MARKER: {
mark: "\u0301",
location: "after-vowel",
exclude: "single"
},
longVowels: true,
shevaAfterMeteg: true,
sqnmlvy: true,
qametsQatan: true,
wawShureq: true,
article: true,
allowNoNiqqud: true,
strict: false,
holemHaser: "remove"
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
romaniote
});
//# sourceMappingURL=romaniote.js.map