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
Section titled “Extends”Node
<Word
>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Word(
text
,sylOpts
,original?
):Word
Defined in: word.ts:80
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
text | string |
sylOpts | SylOpts |
original? | string |
Returns
Section titled “Returns”Word
Overrides
Section titled “Overrides”Properties
Section titled “Properties”next:
null
|Node
<Word
>
Defined in: node.ts:9
Reference to the next node in the sequence.
Inherited from
Section titled “Inherited from”prev:
null
|Node
<Word
>
Defined in: node.ts:12
Reference to the previous node in the sequence.
Inherited from
Section titled “Inherited from”value:
null
|Word
Defined in: node.ts:15
The value stored in this node.
Inherited from
Section titled “Inherited from”whiteSpaceAfter
Section titled “whiteSpaceAfter”whiteSpaceAfter:
null
|string
Defined in: word.ts:77
The white space that appears after the word
Returns
Section titled “Returns”any white space that appears after the word such as a space or new line
Example
Section titled “Example”const heb = `עֶבֶדאֱלֹהִים`;const text = new Text(heb);text.words;// [// Word {// original: 'עֶבֶד\n',// text: 'עֶבֶד',// whiteSpaceBefore: '',// whiteSpaceAfter: '\n'// },// Word {// original: 'אֱלֹהִים',// text: 'אֱלֹהִים',// whiteSpaceBefore: '',// whiteSpaceAfter: ''// }// ]
whiteSpaceBefore
Section titled “whiteSpaceBefore”whiteSpaceBefore:
null
|string
Defined in: word.ts:47
The white space that appears before the word
Returns
Section titled “Returns”any white space that appears before the word such as a space or new line
Example
Section titled “Example”const heb = `עֶבֶדאֱלֹהִים`;const text = new Text(heb);text.words;// [// Word {// original: 'עֶבֶד\n',// text: 'עֶבֶד',// whiteSpaceBefore: '',// whiteSpaceAfter: '\n'// },// Word {// original: 'אֱלֹהִים',// text: 'אֱלֹהִים',// whiteSpaceBefore: '',// whiteSpaceAfter: ''// }// ]
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get chars():
Char
[]
Defined in: word.ts:139
Gets all the Characters in the Word
Example
Section titled “Example”const text = new Text("אֵיפֹה־אַתָּה מֹשֶה");text.words[0].chars;// [// Char { original: "א" },// Char { original: "ֵ" }, (tsere)// Char { original: "פ" },// Char { original: "ֹ" }, (holem)// Char { original: "ה"},// Char { original: "־" }// ]
Returns
Section titled “Returns”Char
[]
a one dimensional array of Chars
clusters
Section titled “clusters”Get Signature
Section titled “Get Signature”get clusters():
Cluster
[]
Defined in: word.ts:160
Gets all the Clusters in the Word
Example
Section titled “Example”const text = new Text("אֵיפֹה־אַתָּה מֹשֶה");text.words[0].clusters;// [// Cluster { original: "אֵ" },// Cluster { original: "י" },// Cluster { original: "פֹ" },// Cluster { original: "ה־" }// ]
Returns
Section titled “Returns”Cluster
[]
a one dimensional array of Clusters
consonantNames
Section titled “consonantNames”Get Signature
Section titled “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
Section titled “Example”const text = new Text("הָאָ֖רֶץ");text.words[0].consonantNames;// ["HE", "ALEF", "RESH", "FINAL_TSADI"]
Returns
Section titled “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
Section titled “consonants”Get Signature
Section titled “Get Signature”get consonants(): (
"א"
|"ב"
|"ג"
|"ד"
|"ה"
|"ו"
|"ז"
|"ח"
|"ט"
|"י"
|"ך"
|"כ"
|"ל"
|"ם"
|"מ"
|"ן"
|"נ"
|"ס"
|"ע"
|"ף"
|"פ"
|"ץ"
|"צ"
|"ק"
|"ר"
|"ש"
|"ת"
)[]
Defined in: word.ts:180
Gets all the consonant characters in the Word
Example
Section titled “Example”const text = new Text("הָאָ֖רֶץ");text.words[0].consonants;// ["ה", "א", "ר", "ץ"]
Returns
Section titled “Returns”("א"
| "ב"
| "ג"
| "ד"
| "ה"
| "ו"
| "ז"
| "ח"
| "ט"
| "י"
| "ך"
| "כ"
| "ל"
| "ם"
| "מ"
| "ן"
| "נ"
| "ס"
| "ע"
| "ף"
| "פ"
| "ץ"
| "צ"
| "ק"
| "ר"
| "ש"
| "ת"
)[]
a one dimensional array of all the consonant characters in the Word
hasDivineName
Section titled “hasDivineName”Get Signature
Section titled “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
Section titled “Example”const text = new Text("בַּֽיהוָ֔ה");text.words[0].hasDivineName;// true
Returns
Section titled “Returns”boolean
a boolean indicating if the word has a form of the Divine Name
isDivineName
Section titled “isDivineName”Get Signature
Section titled “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
Section titled “Example”const text = new Text("יְהוָה");text.words[0].isDivineName;// true
Returns
Section titled “Returns”boolean
a boolean indicating if the text is a form of the Divine Name
isInConstruct
Section titled “isInConstruct”Get Signature
Section titled “Get Signature”get isInConstruct():
boolean
Defined in: word.ts:337
Checks if the Word is in a construct state
Example
Section titled “Example”const text = new Text("בֶּן־אָדָ֕ם");text.words[0].isInConstruct;// true
Remarks
Section titled “Remarks”The construct state is indicated by the presence of a maqqef (U+05BE) character
Returns
Section titled “Returns”boolean
a boolean indicating if the Word is in a construct state
isNotHebrew
Section titled “isNotHebrew”Get Signature
Section titled “Get Signature”get isNotHebrew():
boolean
Defined in: word.ts:318
Checks if the Word contains non-Hebrew characters
Example
Section titled “Example”const text = new Text("Hi!");text.words[0].isNotHebrew;// true
Remarks
Section titled “Remarks”If the word contains non-Hebrew characters, it is not considered Hebrew because syllabification is likely not correct.
Returns
Section titled “Returns”boolean
a boolean indicating if the Word contains non-Hebrew characters
original
Section titled “original”Get Signature
Section titled “Get Signature”get original():
string
Defined in: word.ts:350
The original string passed
Remarks
Section titled “Remarks”The original string passed to the constructor still undergoes the normalization and sequence process, just not checked against any KetivQeres.
Returns
Section titled “Returns”string
the original string passed
siblings
Section titled “siblings”Get Signature
Section titled “Get Signature”get siblings():
Node
<T
>[]
Defined in: node.ts:63
Gets the siblings of this node.
Returns
Section titled “Returns”Node
<T
>[]
An array of Node
Set Signature
Section titled “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
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
arr | Node <T >[] | An array of Node |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”syllables
Section titled “syllables”Get Signature
Section titled “Get Signature”get syllables():
Syllable
[]
Defined in: word.ts:369
Gets all the Syllables in the Word
Example
Section titled “Example”const text = new Text("אֵיפֹה־אַתָּה מֹשֶה");text.words[0].syllables;// [// Syllable { original: "אֵי" },// Syllable { original: "פֹה־" }// ]
Returns
Section titled “Returns”Syllable
[]
a one dimensional array of Syllables
taamim
Section titled “taamim”Get Signature
Section titled “Get Signature”get taamim(): (
"֑"
|"֒"
|"֓"
|"֔"
|"֕"
|"֖"
|"֗"
|"֘"
|"֙"
|"֚"
|"֛"
|"֜"
|"֝"
|"֞"
|"֟"
|"֠"
|"֡"
|"֢"
|"֣"
|"֤"
|"֥"
|"֦"
|"֧"
|"֨"
|"֩"
|"֪"
|"֫"
|"֬"
|"֭"
|"֮"
)[]
Defined in: word.ts:394
Gets all the taamim characters in the Word
Example
Section titled “Example”const text = new Text("הָאָ֖רֶץ");text.words[0].taamim;// ["\u{596}"];
Returns
Section titled “Returns”("֑"
| "֒"
| "֓"
| "֔"
| "֕"
| "֖"
| "֗"
| "֘"
| "֙"
| "֚"
| "֛"
| "֜"
| "֝"
| "֞"
| "֟"
| "֠"
| "֡"
| "֢"
| "֣"
| "֤"
| "֥"
| "֦"
| "֧"
| "֨"
| "֩"
| "֪"
| "֫"
| "֬"
| "֭"
| "֮"
)[]
a one dimensional array of all the taamim characters in the Word
taamimNames
Section titled “taamimNames”Get Signature
Section titled “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:410
Gets all the taamim names in the Word
Example
Section titled “Example”const text = new Text("הָאָ֖רֶץ");text.words[0].taamimNames;// ["TIPEHA"];
Returns
Section titled “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
Get Signature
Section titled “Get Signature”get text():
string
Defined in: word.ts:431
Gets the text of the Word
Example
Section titled “Example”const text = new Text("אֵיפֹה־אַתָּה מֹשֶה");const words = text.words.map((word) => word.text);words;// [// "אֵיפֹה־",// "אַתָּה",// "מֹשֶׁה"// ]
Returns
Section titled “Returns”string
the word’s text trimmed of any whitespace characters
vowelNames
Section titled “vowelNames”Get Signature
Section titled “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:447
Gets all the vowel names in the Word
Example
Section titled “Example”const text = new Text("אֵיפֹה־אַתָּה מֹשֶה");text.words[0].vowelNames;// ["HOLAM", "SEGOL"];
Returns
Section titled “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
Section titled “vowels”Get Signature
Section titled “Get Signature”get vowels(): (
"ֱ"
|"ֲ"
|"ֳ"
|"ִ"
|"ֵ"
|"ֶ"
|"ַ"
|"ָ"
|"ֹ"
|"ֺ"
|"ֻ"
|"ׇ"
|"ְ"
|"וּ"
)[]
Defined in: word.ts:463
Gets all the vowel characters in the Word
Example
Section titled “Example”const text = new Text("אֵיפֹה־אַתָּה מֹשֶה");text.words[0].vowels;// ["\u{5B9}", "\u{5B6}"];
Returns
Section titled “Returns”("ֱ"
| "ֲ"
| "ֳ"
| "ִ"
| "ֵ"
| "ֶ"
| "ַ"
| "ָ"
| "ֹ"
| "ֺ"
| "ֻ"
| "ׇ"
| "ְ"
| "וּ"
)[]
an array of all the vowel characters in the Word
Methods
Section titled “Methods”hasConsonantName()
Section titled “hasConsonantName()”hasConsonantName(
name
):boolean
Defined in: word.ts:217
Checks if the word contains the consonant character of the name passed in
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
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
Section titled “Returns”boolean
a boolean indicating if the word contains the consonant character of the name passed in
Example
Section titled “Example”const text = new Text("הָאָ֖רֶץ");text.words[0].hasConsonantName("HE");// truetext.words[0].hasConsonantName("MEM");// false
Remarks
Section titled “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()
Section titled “hasTaamName()”hasTaamName(
name
):boolean
Defined in: word.ts:253
Checks if the word contains the taamim character of the name passed in
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
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
Section titled “Returns”boolean
a boolean indicating if the word contains the taamim character of the name passed in
Example
Section titled “Example”const text = new Text("הָאָ֖רֶץ");text.word[0].hasTaamName("TIPEHA");// true
Remarks
Section titled “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()
Section titled “hasVowelName()”hasVowelName(
name
):boolean
Defined in: word.ts:283
Checks if the word contains the vowel character of the name passed in
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
name | "HATAF_SEGOL" | "HATAF_PATAH" | "HATAF_QAMATS" | "HIRIQ" | "TSERE" | "SEGOL" | "PATAH" | "QAMATS" | "HOLAM" | "HOLAM_HASER" | "QUBUTS" | "QAMATS_QATAN" | "SHEVA" | "SHUREQ" |
Returns
Section titled “Returns”boolean
a boolean indicating if the word contains the vowel character of the name passed in
Example
Section titled “Example”const text = new Text("הַיְחָבְרְךָ")'text.word[0].hasVowelName("PATAH");// true
// test for vocal shevatext.word[0].hasVowelName("SHEVA");// true
// test for silent shevatext.word[0].hasVowelName("SHUREQ");// false
Remarks
Section titled “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’).