diff --git a/src/utils/syllabifier.ts b/src/utils/syllabifier.ts index 9ed65c6..afdee1c 100644 --- a/src/utils/syllabifier.ts +++ b/src/utils/syllabifier.ts @@ -514,7 +514,7 @@ const reinsertLatin = (syls: Syllable[], latin: { cluster: Cluster; pos: number return syls; }; -export const syllabify = (clusters: Cluster[], options: SylOpts): Syllable[] => { +export const syllabify = (clusters: Cluster[], options: SylOpts, isWordInConstruct: boolean): Syllable[] => { const removeLatin = clusters.filter((cluster) => !cluster.isNotHebrew); const latinClusters = clusters.map(clusterPos).filter((c) => c.cluster.isNotHebrew); const groupedClusters = groupClusters(removeLatin, options); @@ -530,7 +530,8 @@ export const syllabify = (clusters: Cluster[], options: SylOpts): Syllable[] => syllables.forEach(setIsAccented); // if there is no accented syllable, then the last syllable is accented - if (!syllables.map((s) => s.isAccented).includes(true)) { + // unless that syllable is part of a word in construct + if (!syllables.map((s) => s.isAccented).includes(true) && !isWordInConstruct) { syllables[syllables.length - 1].isAccented = true; } diff --git a/src/word.ts b/src/word.ts index 13099a1..d4e4e83 100644 --- a/src/word.ts +++ b/src/word.ts @@ -142,7 +142,7 @@ export class Word { return [syl]; } - const syllables = syllabify(this.clusters, this.sylOpts); + const syllables = syllabify(this.clusters, this.sylOpts, this.isInConstruct); syllables.forEach((syl) => (syl.word = this)); return syllables; diff --git a/test/syllable.isAccented.test.ts b/test/syllable.isAccented.test.ts index 381b4bb..254f246 100644 --- a/test/syllable.isAccented.test.ts +++ b/test/syllable.isAccented.test.ts @@ -14,6 +14,10 @@ describe("Test if a syllable is accented", () => { testIsAccented("דָּבָר", [false, true]); }); + test("If in construct, no accent", () => { + testIsAccented("כָּל־הָעָ֖ם", [false, false, true]); + }); + describe("Taamim that fall on the stressed syllable", () => { test("silluq", () => { testIsAccented("חֽוּשָׁה׃", [true, false]);