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”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Word(
text,sylOpts,original?):Word
Defined in: word.ts:81
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”children
Section titled “children”Defined in: node.ts:21
Collection of child nodes.
Inherited from
Section titled “Inherited from”next:
Node<Word,null,null> |null=null
Defined in: node.ts:11
Next sibling in the sequence.
Inherited from
Section titled “Inherited from”parent
Section titled “parent”parent:
Node<null,any,any> |null=null
Defined in: node.ts:18
Reference to the parent container.
Inherited from
Section titled “Inherited from”prev:
Node<Word,null,null> |null=null
Defined in: node.ts:13
Previous sibling in the sequence.
Inherited from
Section titled “Inherited from”value:
Word|null=null
Defined in: node.ts:15
Node data.
Inherited from
Section titled “Inherited from”whiteSpaceAfter
Section titled “whiteSpaceAfter”whiteSpaceAfter:
string|null
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:
string|null
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:140
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:161
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:197
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:181
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:234
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;// trueReturns
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:300
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;// trueReturns
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:338
Checks if the Word is in a construct state
Example
Section titled “Example”const text = new Text("בֶּן־אָדָ֕ם");text.words[0].isInConstruct;// trueRemarks
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:319
Checks if the Word contains non-Hebrew characters
Example
Section titled “Example”const text = new Text("Hi!");text.words[0].isNotHebrew;// trueRemarks
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:373
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<Self,Child,any>[]
Defined in: node.ts:45
Retrieves all subsequent nodes in the current sibling chain.
Returns
Section titled “Returns”Node<Self, Child, any>[]
Set Signature
Section titled “Set Signature”set siblings(
arr):void
Defined in: node.ts:29
Connects an array of nodes as a doubly-linked sibling chain starting after this node.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
arr |
Node<Self, Child, any>[] |
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:392
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:437
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:453
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:474
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:490
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:506
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:218
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");// falseRemarks
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:254
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");// trueRemarks
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:284
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");// falseRemarks
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’).
isSyllableFinal()
Section titled “isSyllableFinal()”isSyllableFinal(
syllable):boolean
Defined in: word.ts:349
Checks if the syllable is the final syllable in the Word
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
syllable |
Syllable |
- |
Returns
Section titled “Returns”boolean
a boolean indicating if the syllable is the final syllable in the Word
isSyllableInitial()
Section titled “isSyllableInitial()”isSyllableInitial(
syllable):boolean
Defined in: word.ts:360
Checks if the syllable is the initial syllable in the Word
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
syllable |
Syllable |
- |
Returns
Section titled “Returns”boolean
a boolean indicating if the syllable is the initial syllable in the Word
syllablePosition()
Section titled “syllablePosition()”syllablePosition(
syllable):number
Defined in: word.ts:417
Gets the position of a syllable within the Word
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
syllable |
Syllable |
- |
Returns
Section titled “Returns”number
the position of the syllable within the Word (0-based index)