Interface SylOpts

options for determining syllabification that may differ according to reading traditions

interface SylOpts {
    allowNoNiqqud?: boolean;
    article?: boolean;
    holemHaser?: "update" | "preserve" | "remove";
    longVowels?: boolean;
    qametsQatan?: boolean;
    shevaAfterMeteg?: boolean;
    shevaWithMeteg?: boolean;
    sqnmlvy?: boolean;
    strict?: boolean;
    wawShureq?: boolean;
}

Properties

allowNoNiqqud?: boolean

allows text with no niqqud to be passed; words with no niqqud or incomplete pointing will not be syllabified

Default Value

false

Example

const text = new Text("בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים", { allowNoNiqqud: true })
text.syllables.map(syl => syl.text);
// [ 'בְּ', 'רֵא', 'שִׁ֖ית', 'בָּרא', 'אלהים' ]
// note 2nd word has incomplete pointing, and 3rd has none

Remarks

results in example displayed in reverse order to mimic Hebrew writing; the rightmost value is the 0 item

article?: boolean

determines whether to regard the sheva under the letters ילמ when preceded by the article and with a missing dagesh chazaq as as a sheva na'.

Default Value

true

Example

const usingDefault = new Text("הַיְאֹ֗ר");
usingDefault.syllables.map(syl => syl.text);
// ["הַ", "יְ", "אֹ֗ר"]

const optional = new Text("הַיְאֹ֗ר", { article: false });
optional.syllables.map(syl => syl.text);
// ["הַיְ", "אֹ֗ר"]

Remarks

results in example displayed in reverse order to mimic Hebrew writing; the rightmost value is the 0 item

holemHaser?: "update" | "preserve" | "remove"

how to handle the code point \u{05BA} HOLAM HASER FOR VAV

Options

  • "update" - converts all holems in a vav + holem sequence where vav is a consonant to HOLAM HASER FOR VAV
  • "preserve" - leaves the text as is — does not remove HOLAM HASER FOR VAV, but does not update
  • "remove" - converts all HOLAM HASER FOR VAV to regular holem

Default Value

preserve

Example: update

const holemHaser = /\u{05BA}/u;
const str = "עָוֹן" // vav + holem
holemHaser.test(str); // false
const newStr = new Text(updated, { holemHaser: "update" }).text;
holemHaser.test(newStr); // true

Example: preserve

const holemHaser = /\u{05BA}/u;
const str = "עָוֹן" // vav + holem
holemHaser.test(str); // false
const newStr = new Text(updated, { holemHaser: "preserve" }).text;
holemHaser.test(newStr); // false

Example: remove

const holemHaser = /\u{05BA}/u;
const str = "עָוֺן" // vav + holem haser
holemHaser.test(str); // true
const newStr = new Text(updated, { holemHaser: "remove" }).text;
holemHaser.test(newStr); // false
longVowels?: boolean

determines whether to regard a sheva after a long vowel (excluding waw-shureq, see wawShureq) as a sheva na', unless preceded by a meteg (see shevaAfterMeteg).

Default Value

true

Example

const usingDefault = new Text("יָדְךָ");
usingDefault.syllables.map(syl => syl.text);
// ["יָ", "דְ", "ךָ"]

const optional = new Text("יָדְךָ", { longVowels: false });
optional.syllables.map(syl => syl.text);
// ["יָדְ", "ךָ"]

Remarks

results in example displayed in reverse order to mimic Hebrew writing; the rightmost value is the 0 item

qametsQatan?: boolean

converts regular qamets characters to qamets qatan characters where appropriate. The former is a "long-vowel" whereas the latter is a "short-vowel."

Default Value

true

Example

const qQRegx = /\u{05C7}/u;
const usingDefault = new Text("חָפְנִי֙");
qQRegx.test(default.text);
// true

const optional = new Text("חָפְנִי֙", { qametsQatan: false });
qQRegx.test(optional.text);
// false
shevaAfterMeteg?: boolean

determines whether to regard the sheva after a meteg as a sheva na'.

Default Value

true

Example

const usingDefault = new Text("יְדַֽעְיָה");
usingDefault.syllables.map((s) => ({ text: s.text, isClosed: s.isClosed }));
// [
// { text: 'יְ', isClosed: false },
// { text: 'דַֽ', isClosed: false },
// { text: 'עְ', isClosed: false },
// { text: 'יָה', isClosed: false }
// ]

const optional = new Text("יְדַֽעְיָה", { shevaAfterMeteg: false });
optional.syllables.map((s) => ({ text: s.text, isClosed: s.isClosed }));
// [
// { text: 'יְ', isClosed: false },
// { text: 'דַֽעְ', isClosed: true },
// { text: 'יָה', isClosed: false }
// ]
shevaWithMeteg?: boolean

determines whether to regard a sheva with a meteg as a sheva na'. This is also called a sheva ga'ya.

Default Value

true

Example

const usingDefault = new Text("אַ֥שְֽׁרֵי");
usingusingDefault.syllables.map((s) => ({ text: s.text, isClosed: s.isClosed }));
// [
// { text: 'אַ֥', isClosed: false },
// { text: 'שְֽׁ', isClosed: false },
// { text: 'רֵי', isClosed: false }
// ]

const optional = new Text("אַ֥שְֽׁרֵי", { shevaWithMeteg: false });
optional.syllables.map((s) => ({ text: s.text, isClosed: s.isClosed }));
// [
// { text: 'אַ֥שְֽׁ', isClosed: true },
// { text: 'רֵי', isClosed: false }
// ]
sqnmlvy?: boolean

determines whether to regard the sheva under the letters שׁשׂסצנמלוי when preceded by a waw-consecutive with a missing dagesh chazaq as a sheva na', unless preceded by a meteg (see shevaAfterMeteg).

Default Value

true

Example

const usingDefault = new Text("וַיְצַחֵק֙");
usingDefault.syllables.map(syl => syl.text);
// ["וַ", "יְ", "צַ", "חֵק֙"]

const optional = new Text("וַיְצַחֵק֙", { sqnmlvy: false });
optional.syllables.map(syl => syl.text);
// ["וַיְ", "צַ", "חֵק֙"]
strict?: boolean

whether to syllabify incorrectly pointed text

Default Value

true

Example

const text1 = new Text("לְוּדְרְדַּיְל", { strict: true });
// Error: Syllable לְ should not precede a Cluster with a Shureq in דַּיְלרְדְוּלְ

const text2 = new Text("לְוּדְרְדַּיְל", { strict: false });
text2.syllables.map(syl => syl.text);
// [ 'וּ', 'דְ', 'רְ', 'דַּיְל' ]

Remarks

when false results in syllabification can vary

wawShureq?: boolean

determines whether to regard a sheva after a vav-shureq as vocal, unless preceded by a meteg (see shevaAfterMeteg).

Default Value

true

Example

const usingDefault = new Text("וּלְמַזֵּר");
usingDefault.syllables.map(syl => syl.text);
// "וּ", "לְ", "מַ", "זֵּר"]

const optional = new Text("וּלְמַזֵּר", { wawShureq: false });
optional.syllables.map(syl => syl.text);
// ["וּלְ", "מַ", "זֵּר"]

Remarks

results in example displayed in reverse order to mimic Hebrew writing; the rightmost value is the 0 item

Generated using TypeDoc