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.

Extends

Constructors

Constructor

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

Defined in: word.ts:80

Parameters

ParameterType
textstring
sylOptsSylOpts
original?string

Returns

Word

Overrides

Node.constructor

Properties

next

next: null | Node<Word>

Defined in: node.ts:9

Reference to the next node in the sequence.

Inherited from

Node.next


prev

prev: null | Node<Word>

Defined in: node.ts:12

Reference to the previous node in the sequence.

Inherited from

Node.prev


value

value: null | Word

Defined in: node.ts:15

The value stored in this node.

Inherited from

Node.value


whiteSpaceAfter

whiteSpaceAfter: null | string

Defined in: word.ts:77

The white space that appears after the word

Returns

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

Example

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

whiteSpaceBefore

whiteSpaceBefore: null | string

Defined in: word.ts:47

The white space that appears before the word

Returns

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

Example

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

Accessors

chars

Get Signature

get chars(): Char[]

Defined in: word.ts:139

Gets all the Characters in the Word

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

Char[]

a one dimensional array of Chars


clusters

Get Signature

get clusters(): Cluster[]

Defined in: word.ts:160

Gets all the Clusters in the Word

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

Cluster[]

a one dimensional array of Clusters


consonantNames

Get Signature

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

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

("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


consonants

Get Signature

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

Defined in: word.ts:180

Gets all the consonant characters in the Word

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

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

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


hasDivineName

Get Signature

get hasDivineName(): boolean

Defined in: word.ts:233

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

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

boolean

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


isDivineName

Get Signature

get isDivineName(): boolean

Defined in: word.ts:299

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

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

boolean

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


isInConstruct

Get Signature

get isInConstruct(): boolean

Defined in: word.ts:337

Checks if the Word is in a construct state

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

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

Returns

boolean

a boolean indicating if the Word is in a construct state


isNotHebrew

Get Signature

get isNotHebrew(): boolean

Defined in: word.ts:318

Checks if the Word contains non-Hebrew characters

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

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

Returns

boolean

a boolean indicating if the Word contains non-Hebrew characters


original

Get Signature

get original(): string

Defined in: word.ts:353

The original string passed

Description

The original string passed to the constructor that has not been checked against any KetivQeres.

Remarks

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

Returns

string

the original string passed


siblings

Get Signature

get siblings(): Node<T>[]

Defined in: node.ts:63

Gets the siblings of this node.

Returns

Node<T>[]

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

Set Signature

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.

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

void

Inherited from

Node.siblings


syllables

Get Signature

get syllables(): Syllable[]

Defined in: word.ts:372

Gets all the Syllables in the Word

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

Syllable[]

a one dimensional array of Syllables


taamim

Get Signature

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

Defined in: word.ts:397

Gets all the taamim characters in the Word

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

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

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


taamimNames

Get Signature

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:413

Gets all the taamim names in the Word

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

("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


text

Get Signature

get text(): string

Defined in: word.ts:434

Gets the text of the Word

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

string

the word’s text trimmed of any whitespace characters


vowelNames

Get Signature

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:450

Gets all the vowel names in the Word

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

("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


vowels

Get Signature

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

Defined in: word.ts:466

Gets all the vowel characters in the Word

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

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

an array of all the vowel characters in the Word

Methods

hasConsonantName()

hasConsonantName(name): boolean

Defined in: word.ts:217

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

Parameters

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"

Returns

boolean

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

Example

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

Remarks

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


hasTaamName()

hasTaamName(name): boolean

Defined in: word.ts:253

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

Parameters

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"

Returns

boolean

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

Example

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

Remarks

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()

hasVowelName(name): boolean

Defined in: word.ts:283

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

Parameters

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

Returns

boolean

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

Example

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

Remarks

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’).