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: ''
// }
// ]
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: ''
// }
// ]
Gets all the characters in the Word
a one dimensional array of Chars
const text = new Text("אֵיפֹה־אַתָּה מֹשֶה");
text.words[0].chars;
// [
// Char { original: "א" },
// Char { original: "ֵ" }, (tsere)
// Char { original: "פ" },
// Char { original: "ֹ" }, (holem)
// Char { original: "ה"},
// Char { original: "־" }
// ]
Gets all the clusters in the Word
a one dimensional array of Clusters
const text = new Text("אֵיפֹה־אַתָּה מֹשֶה");
text.words[0].clusters;
// [
// Cluster { original: "אֵ" },
// Cluster { original: "י" },
// Cluster { original: "פֹ" },
// Cluster { original: "ה־" }
// ]
Gets all the consonant character names in the Word
a one dimensional array of all the consonant character names in the Word
const text = new Text("הָאָ֖רֶץ");
text.words[0].consonantNames;
// ["HE", "ALEF", "RESH", "FINAL_TSADI"]
Gets all the consonant characters in the Word
a one dimensional array of all the consonant characters in the Word
const text = new Text("הָאָ֖רֶץ");
text.words[0].consonants;
// ["ה", "א", "ר", "ץ"]
Checks if the word has a form of the Divine Name (i.e the tetragrammaton)
a boolean indicating if the word has a form of the Divine Name
const text = new Text("בַּֽיהוָ֔ה");
text.words[0].hasDivineName;
// true
Checks if the text is a form of the Divine Name (i.e the tetragrammaton)
a boolean indicating if the text is a form of the Divine Name
const text = new Text("יְהוָה");
text.words[0].isDivineName;
// true
Checks if the Word is in a construct state
a boolean indicating 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
Checks if the Word contains non-Hebrew characters
a boolean indicating 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.
Gets all the taamim characters in the Word
a one dimensional array of all the taamim characters in the Word
const text = new Text("הָאָ֖רֶץ");
text.words[0].taamim;
// ["\u{596}"];
Gets all the taamim names in the Word
a one dimensional array of all the taamim names in the Word
const text = new Text("הָאָ֖רֶץ");
text.words[0].taamimNames;
// ["TIPEHA"];
Gets the text of the Word
the word's text trimmed of any whitespace characters
const text = new Text("אֵיפֹה־אַתָּה מֹשֶה");
const words = text.words.map((word) => word.text);
words;
// [
// "אֵיפֹה־",
// "אַתָּה",
// "מֹשֶׁה"
// ]
Gets all the vowel characters in the Word
an array of all the vowel characters in the Word
const text = new Text("אֵיפֹה־אַתָּה מֹשֶה");
text.words[0].vowels;
// ["\u{5B9}", "\u{5B6}"];
Checks if the word contains the consonant character of the name passed in
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).
Checks if the word contains the taamim character of the name passed in
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
Checks if the word contains the vowel character of the name passed in
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 {@page 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').
Generated using TypeDoc
A subunit of a Text consisting of words, which are strings are text separated by spaces or maqqefs.