Skip to content

Commit

Permalink
Add logic for isInConstruct
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Loder committed Dec 30, 2023
1 parent b99c98c commit 17f717e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/word.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,15 @@ export class Word {
get isNotHebrew(): boolean {
return !this.clusters.map((c) => c.isNotHebrew).includes(false);
}

/**
* Returns `true` if the Word is in a construct state
*
* @description
* The construct state is indicated by the presence of a maqqef (U+05BE) character
*/
get isInConstruct(): boolean {
// if word has a maqqef, it is in construct
return this.text.includes("\u05BE");
}
}

0 comments on commit 17f717e

Please sign in to comment.