Skip to content

Word

Defined in: word.ts:13

A subunit of a Text consisting of words, which are strings are text separated by spaces or maqqefs.

new Word(text, sylOpts, original?): Word

Defined in: word.ts:80

ParameterType
textstring
sylOptsSylOpts
original?string

Word

Node.constructor

next: null | Node<Word>

Defined in: node.ts:9

Reference to the next node in the sequence.

Node.next


prev: null | Node<Word>

Defined in: node.ts:12

Reference to the previous node in the sequence.

Node.prev


value: null | Word

Defined in: node.ts:15

The value stored in this node.

Node.value


whiteSpaceAfter: null | string

Defined in: word.ts:77

The white space that appears after the word

any white space that appears after the word such as a space or new line

const heb = `
עֶבֶד
אֱלֹהִים
`;
const text = new Text(heb);
text.words;
// [
// Word {
// original: 'עֶבֶד\n',
// text: 'עֶבֶד',
// whiteSpaceBefore: '',
// whiteSpaceAfter: '\n'
// },
// Word {
// original: 'אֱלֹהִים',
// text: 'אֱלֹהִים',
// whiteSpaceBefore: '',
// whiteSpaceAfter: ''
// }
// ]

whiteSpaceBefore: null | string

Defined in: word.ts:47

The white space that appears before the word

any white space that appears before the word such as a space or new line

const heb = `
עֶבֶד
אֱלֹהִים
`;
const text = new Text(heb);
text.words;
// [
// Word {
// original: 'עֶבֶד\n',
// text: 'עֶבֶד',
// whiteSpaceBefore: '',
// whiteSpaceAfter: '\n'
// },
// Word {
// original: 'אֱלֹהִים',
// text: 'אֱלֹהִים',
// whiteSpaceBefore: '',
// whiteSpaceAfter: ''
// }
// ]

get chars(): Char[]

Defined in: word.ts:139

Gets all the Characters in the Word

const text = new Text("אֵיפֹה־אַתָּה מֹשֶה");
text.words[0].chars;
// [
// Char { original: "א" },
// Char { original: "ֵ" }, (tsere)
// Char { original: "פ" },
// Char { original: "ֹ" }, (holem)
// Char { original: "ה"},
// Char { original: "־" }
// ]

Char[]

a one dimensional array of Chars


get clusters(): Cluster[]

Defined in: word.ts:160

Gets all the Clusters in the Word

const text = new Text("אֵיפֹה־אַתָּה מֹשֶה");
text.words[0].clusters;
// [
// Cluster { original: "אֵ" },
// Cluster { original: "י" },
// Cluster { original: "פֹ" },
// Cluster { original: "ה־" }
// ]

Cluster[]

a one dimensional array of Clusters


get consonantNames(): ("ALEF" | "BET" | "GIMEL" | "DALET" | "HE" | "VAV" | "ZAYIN" | "HET" | "TET" | "YOD" | "FINAL_KAF" | "KAF" | "LAMED" | "FINAL_MEM" | "MEM" | "FINAL_NUN" | "NUN" | "SAMEKH" | "AYIN" | "FINAL_PE" | "PE" | "FINAL_TSADI" | "TSADI" | "QOF" | "RESH" | "SHIN" | "TAV")[]

Defined in: word.ts:196

Gets all the consonant character names in the Word

const text = new Text("הָאָ֖רֶץ");
text.words[0].consonantNames;
// ["HE", "ALEF", "RESH", "FINAL_TSADI"]

("ALEF" | "BET" | "GIMEL" | "DALET" | "HE" | "VAV" | "ZAYIN" | "HET" | "TET" | "YOD" | "FINAL_KAF" | "KAF" | "LAMED" | "FINAL_MEM" | "MEM" | "FINAL_NUN" | "NUN" | "SAMEKH" | "AYIN" | "FINAL_PE" | "PE" | "FINAL_TSADI" | "TSADI" | "QOF" | "RESH" | "SHIN" | "TAV")[]

a one dimensional array of all the consonant character names in the Word


get consonants(): ("א" | "ב" | "ג" | "ד" | "ה" | "ו" | "ז" | "ח" | "ט" | "י" | "ך" | "כ" | "ל" | "ם" | "מ" | "ן" | "נ" | "ס" | "ע" | "ף" | "פ" | "ץ" | "צ" | "ק" | "ר" | "ש" | "ת")[]

Defined in: word.ts:180

Gets all the consonant characters in the Word

const text = new Text("הָאָ֖רֶץ");
text.words[0].consonants;
// ["ה", "א", "ר", "ץ"]

("א" | "ב" | "ג" | "ד" | "ה" | "ו" | "ז" | "ח" | "ט" | "י" | "ך" | "כ" | "ל" | "ם" | "מ" | "ן" | "נ" | "ס" | "ע" | "ף" | "פ" | "ץ" | "צ" | "ק" | "ר" | "ש" | "ת")[]

a one dimensional array of all the consonant characters in the Word


get hasDivineName(): boolean

Defined in: word.ts:233

Checks if the word has a form of the Divine Name (i.e the tetragrammaton)

const text = new Text("בַּֽיהוָ֔ה");
text.words[0].hasDivineName;
// true

boolean

a boolean indicating if the word has a form of the Divine Name


get isDivineName(): boolean

Defined in: word.ts:299

Checks if the text is a form of the Divine Name (i.e the tetragrammaton)

const text = new Text("יְהוָה");
text.words[0].isDivineName;
// true

boolean

a boolean indicating if the text is a form of the Divine Name


get isInConstruct(): boolean

Defined in: word.ts:337

Checks if the Word is in a construct state

const text = new Text("בֶּן־אָדָ֕ם");
text.words[0].isInConstruct;
// true

The construct state is indicated by the presence of a maqqef (U+05BE) character

boolean

a boolean indicating if the Word is in a construct state


get isNotHebrew(): boolean

Defined in: word.ts:318

Checks if the Word contains non-Hebrew characters

const text = new Text("Hi!");
text.words[0].isNotHebrew;
// true

If the word contains non-Hebrew characters, it is not considered Hebrew because syllabification is likely not correct.

boolean

a boolean indicating if the Word contains non-Hebrew characters


get original(): string

Defined in: word.ts:350

The original string passed

The original string passed to the constructor still undergoes the normalization and sequence process, just not checked against any KetivQeres.

string

the original string passed


get siblings(): Node<T>[]

Defined in: node.ts:63

Gets the siblings of this node.

Node<T>[]

An array of Node representing all subsequent nodes in the sequence.

set siblings(arr): void

Defined in: node.ts:47

Sets the siblings of this node. Establishes bidirectional links between adjacent nodes in the provided array.

ParameterTypeDescription
arrNode<T>[]An array of Node to set as siblings.

void

Node.siblings


get syllables(): Syllable[]

Defined in: word.ts:369

Gets all the Syllables in the Word

const text = new Text("אֵיפֹה־אַתָּה מֹשֶה");
text.words[0].syllables;
// [
// Syllable { original: "אֵי" },
// Syllable { original: "פֹה־" }
// ]

Syllable[]

a one dimensional array of Syllables


get taamim(): ("֑" | "֒" | "֓" | "֔" | "֕" | "֖" | "֗" | "֘" | "֙" | "֚" | "֛" | "֜" | "֝" | "֞" | "֟" | "֠" | "֡" | "֢" | "֣" | "֤" | "֥" | "֦" | "֧" | "֨" | "֩" | "֪" | "֫" | "֬" | "֭" | "֮")[]

Defined in: word.ts:394

Gets all the taamim characters in the Word

const text = new Text("הָאָ֖רֶץ");
text.words[0].taamim;
// ["\u{596}"];

("֑" | "֒" | "֓" | "֔" | "֕" | "֖" | "֗" | "֘" | "֙" | "֚" | "֛" | "֜" | "֝" | "֞" | "֟" | "֠" | "֡" | "֢" | "֣" | "֤" | "֥" | "֦" | "֧" | "֨" | "֩" | "֪" | "֫" | "֬" | "֭" | "֮")[]

a one dimensional array of all the taamim characters in the Word


get taamimNames(): ("ETNAHTA" | "SEGOL_ACCENT" | "SHALSHELET" | "ZAQEF_QATAN" | "ZAQEF_GADOL" | "TIPEHA" | "REVIA" | "ZARQA" | "PASHTA" | "YETIV" | "TEVIR" | "GERESH" | "GERESH_MUQDAM" | "GERSHAYIM" | "QARNEY_PARA" | "TELISHA_GEDOLA" | "PAZER" | "ATNAH_HAFUKH" | "MUNAH" | "MAHAPAKH" | "MERKHA" | "MERKHA_KEFULA" | "DARGA" | "QADMA" | "TELISHA_QETANA" | "YERAH_BEN_YOMO" | "OLE" | "ILUY" | "DEHI" | "ZINOR")[]

Defined in: word.ts:410

Gets all the taamim names in the Word

const text = new Text("הָאָ֖רֶץ");
text.words[0].taamimNames;
// ["TIPEHA"];

("ETNAHTA" | "SEGOL_ACCENT" | "SHALSHELET" | "ZAQEF_QATAN" | "ZAQEF_GADOL" | "TIPEHA" | "REVIA" | "ZARQA" | "PASHTA" | "YETIV" | "TEVIR" | "GERESH" | "GERESH_MUQDAM" | "GERSHAYIM" | "QARNEY_PARA" | "TELISHA_GEDOLA" | "PAZER" | "ATNAH_HAFUKH" | "MUNAH" | "MAHAPAKH" | "MERKHA" | "MERKHA_KEFULA" | "DARGA" | "QADMA" | "TELISHA_QETANA" | "YERAH_BEN_YOMO" | "OLE" | "ILUY" | "DEHI" | "ZINOR")[]

a one dimensional array of all the taamim names in the Word


get text(): string

Defined in: word.ts:431

Gets the text of the Word

const text = new Text("אֵיפֹה־אַתָּה מֹשֶה");
const words = text.words.map((word) => word.text);
words;
// [
// "אֵיפֹה־",
// "אַתָּה",
// "מֹשֶׁה"
// ]

string

the word’s text trimmed of any whitespace characters


get vowelNames(): ("HATAF_SEGOL" | "HATAF_PATAH" | "HATAF_QAMATS" | "HIRIQ" | "TSERE" | "SEGOL" | "PATAH" | "QAMATS" | "HOLAM" | "HOLAM_HASER" | "QUBUTS" | "QAMATS_QATAN" | "SHEVA" | "SHUREQ")[]

Defined in: word.ts:447

Gets all the vowel names in the Word

const text = new Text("אֵיפֹה־אַתָּה מֹשֶה");
text.words[0].vowelNames;
// ["HOLAM", "SEGOL"];

("HATAF_SEGOL" | "HATAF_PATAH" | "HATAF_QAMATS" | "HIRIQ" | "TSERE" | "SEGOL" | "PATAH" | "QAMATS" | "HOLAM" | "HOLAM_HASER" | "QUBUTS" | "QAMATS_QATAN" | "SHEVA" | "SHUREQ")[]

an array of all the vowel names in the Word


get vowels(): ("ֱ" | "ֲ" | "ֳ" | "ִ" | "ֵ" | "ֶ" | "ַ" | "ָ" | "ֹ" | "ֺ" | "ֻ" | "ׇ" | "ְ" | "וּ")[]

Defined in: word.ts:463

Gets all the vowel characters in the Word

const text = new Text("אֵיפֹה־אַתָּה מֹשֶה");
text.words[0].vowels;
// ["\u{5B9}", "\u{5B6}"];

("ֱ" | "ֲ" | "ֳ" | "ִ" | "ֵ" | "ֶ" | "ַ" | "ָ" | "ֹ" | "ֺ" | "ֻ" | "ׇ" | "ְ" | "וּ")[]

an array of all the vowel characters in the Word

hasConsonantName(name): boolean

Defined in: word.ts:217

Checks if the word contains the consonant character of the name passed in

ParameterType
name"ALEF" | "BET" | "GIMEL" | "DALET" | "HE" | "VAV" | "ZAYIN" | "HET" | "TET" | "YOD" | "FINAL_KAF" | "KAF" | "LAMED" | "FINAL_MEM" | "MEM" | "FINAL_NUN" | "NUN" | "SAMEKH" | "AYIN" | "FINAL_PE" | "PE" | "FINAL_TSADI" | "TSADI" | "QOF" | "RESH" | "SHIN" | "TAV"

boolean

a boolean indicating if the word contains the consonant character of the name passed in

const text = new Text("הָאָ֖רֶץ");
text.words[0].hasConsonantName("HE");
// true
text.words[0].hasConsonantName("MEM");
// false

This checks if the syllable contains the given consonant name, even if the character is not a phonemic consonant (i.e a mater).


hasTaamName(name): boolean

Defined in: word.ts:253

Checks if the word contains the taamim character of the name passed in

ParameterType
name"ETNAHTA" | "SEGOL_ACCENT" | "SHALSHELET" | "ZAQEF_QATAN" | "ZAQEF_GADOL" | "TIPEHA" | "REVIA" | "ZARQA" | "PASHTA" | "YETIV" | "TEVIR" | "GERESH" | "GERESH_MUQDAM" | "GERSHAYIM" | "QARNEY_PARA" | "TELISHA_GEDOLA" | "PAZER" | "ATNAH_HAFUKH" | "MUNAH" | "MAHAPAKH" | "MERKHA" | "MERKHA_KEFULA" | "DARGA" | "QADMA" | "TELISHA_QETANA" | "YERAH_BEN_YOMO" | "OLE" | "ILUY" | "DEHI" | "ZINOR"

boolean

a boolean indicating if the word contains the taamim character of the name passed in

const text = new Text("הָאָ֖רֶץ");
text.word[0].hasTaamName("TIPEHA");
// true

Note: it only checks according to the character name, not its semantic meaning. E.g. “כֵֽן׃” would be true when checking for "METEG", not silluq


hasVowelName(name): boolean

Defined in: word.ts:283

Checks if the word contains the vowel character of the name passed in

ParameterType
name"HATAF_SEGOL" | "HATAF_PATAH" | "HATAF_QAMATS" | "HIRIQ" | "TSERE" | "SEGOL" | "PATAH" | "QAMATS" | "HOLAM" | "HOLAM_HASER" | "QUBUTS" | "QAMATS_QATAN" | "SHEVA" | "SHUREQ"

boolean

a boolean indicating if the word contains the vowel character of the name passed in

const text = new Text("הַיְחָבְרְךָ")'
text.word[0].hasVowelName("PATAH");
// true
// test for vocal sheva
text.word[0].hasVowelName("SHEVA");
// true
// test for silent sheva
text.word[0].hasVowelName("SHUREQ");
// false

This returns a boolean if the vowel character is present, even for most mater lectionis (e.g. in a holam vav construction, “HOLAM” would return true). The only exception is a shureq, because there is no vowel character for a shureq. According to Syllabification, a sheva is a vowel and serves as the nucleus of a syllable. It returns true for “SHEVA” only when the sheva is the vowel (i.e. a vocal sheva or sheva na’).