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

Hierarchy

Constructors

  • Parameters

    Returns Word

Properties

whiteSpaceAfter: null | string

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: null | string

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

  • get chars(): Char[]
  • Gets all the characters in the Word

    Returns Char[]

    a one dimensional array of Chars

    Example

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

    Returns Cluster[]

    a one dimensional array of Clusters

    Example

    const text = new Text("אֵיפֹה־אַתָּה מֹשֶה");
    text.words[0].clusters;
    // [
    // Cluster { original: "אֵ" },
    // Cluster { original: "י" },
    // Cluster { original: "פֹ" },
    // Cluster { original: "ה־" }
    // ]
  • get consonantNames(): ConsonantName[]
  • Gets all the consonant character names in the Word

    Returns ConsonantName[]

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

    Example

    const text = new Text("הָאָ֖רֶץ");
    text.words[0].consonantNames;
    // ["HE", "ALEF", "RESH", "FINAL_TSADI"]
  • get consonants(): ("א" | "ב" | "ג" | "ד" | "ה" | "ו" | "ז" | "ח" | "ט" | "י" | "ך" | "כ" | "ל" | "ם" | "מ" | "ן" | "נ" | "ס" | "ע" | "ף" | "פ" | "ץ" | "צ" | "ק" | "ר" | "ש" | "ת")[]
  • Gets all the consonant characters in the Word

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

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

    Example

    const text = new Text("הָאָ֖רֶץ");
    text.words[0].consonants;
    // ["ה", "א", "ר", "ץ"]
  • get hasDivineName(): boolean
  • Checks if the word has a form of the Divine Name (i.e the tetragrammaton)

    Returns boolean

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

    Example

    const text = new Text("בַּֽיהוָ֔ה");
    text.words[0].hasDivineName;
    // true
  • get isDivineName(): boolean
  • Checks if the text is a form of the Divine Name (i.e the tetragrammaton)

    Returns boolean

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

    Example

    const text = new Text("יְהוָה");
    text.words[0].isDivineName;
    // true
  • get isInConstruct(): boolean
  • Checks if the Word is in a construct state

    Returns boolean

    a boolean indicating if the Word is in a construct state

    Example

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

    Description

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

  • get isNotHebrew(): boolean
  • Checks if the Word contains non-Hebrew characters

    Returns boolean

    a boolean indicating if the Word contains non-Hebrew characters

    Example

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

    Description

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

  • get syllables(): Syllable[]
  • Gets all the syllables in the Word

    Returns Syllable[]

    a one dimensional array of Syllables

    const text = new Text("אֵיפֹה־אַתָּה מֹשֶה");
    text.words[0].syllables;
    // [
    // Syllable { original: "אֵי" },
    // Syllable { original: "פֹה־" }
    // ]
  • get taamim(): ("֑" | "֒" | "֓" | "֔" | "֕" | "֖" | "֗" | "֘" | "֙" | "֚" | "֛" | "֜" | "֝" | "֞" | "֟" | "֠" | "֡" | "֢" | "֣" | "֤" | "֥" | "֦" | "֧" | "֨" | "֩" | "֪" | "֫" | "֬" | "֭" | "֮")[]
  • Gets all the taamim characters in the Word

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

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

    const text = new Text("הָאָ֖רֶץ");
    text.words[0].taamim;
    // ["\u{596}"];
  • get taamimNames(): TaamimName[]
  • Gets all the taamim names in the Word

    Returns TaamimName[]

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

    const text = new Text("הָאָ֖רֶץ");
    text.words[0].taamimNames;
    // ["TIPEHA"];
  • get text(): string
  • Gets the text of the Word

    Returns string

    the word's text trimmed of any whitespace characters

    const text = new Text("אֵיפֹה־אַתָּה מֹשֶה");
    const words = text.words.map((word) => word.text);
    words;
    // [
    // "אֵיפֹה־",
    // "אַתָּה",
    // "מֹשֶׁה"
    // ]
  • get vowelNames(): VowelName[]
  • Gets all the vowel names in the Word

    Returns VowelName[]

    an array of all the vowel names in the Word

    const text = new Text("אֵיפֹה־אַתָּה מֹשֶה");
    text.words[0].vowelNames;
    // ["HOLAM", "SEGOL"];
  • get vowels(): ("ֱ" | "ֲ" | "ֳ" | "ִ" | "ֵ" | "ֶ" | "ַ" | "ָ" | "ֹ" | "ֺ" | "ֻ" | "ׇ" | "ְ" | "וּ")[]
  • Gets all the vowel characters in the Word

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

    an array of all the vowel characters in the Word

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

Methods

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

    Parameters

    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

    Description

    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

    Parameters

    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

    Description

    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

    Parameters

    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

    Description

    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