Skip to content

Commit

Permalink
Merge pull request #159 from charlesLoder/geresh-muqdam
Browse files Browse the repository at this point in the history
Geresh muqdam
  • Loading branch information
charlesLoder authored Mar 5, 2024
2 parents 4f9bb33 + 4ebaec1 commit 112925b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/utils/syllabifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,13 @@ const setIsAccented = (syllable: Syllable) => {
}
}

// the geresh muqdam always appears before a rebia, which receives the stress
const gereshMuqdam = /\u{059D}/u;
if (gereshMuqdam.test(syllable.text)) {
syllable.isAccented = false;
return;
}

const isAccented = syllable.clusters.filter((cluster) => (cluster.hasTaamim || cluster.hasSilluq ? true : false))
.length
? true
Expand Down
7 changes: 7 additions & 0 deletions test/syllable.isAccented.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,13 @@ describe("Test if a syllable is accented", () => {
testIsAccented("לַ֭יְלָה", [false, true]);
});
});

describe("gersh muqdam", () => {
// for gersh muqdam, always/mostly appears before a rebia, which receives the stress
test("will always be unaccented", () => {
testIsAccented("לֵ֝צִ֗ים", [false, true]);
});
});
});
});

Expand Down

0 comments on commit 112925b

Please sign in to comment.