charlesLoder / havarotjs

A Typescript package for getting syllabic data about Hebrew text with niqqud.
https://www.npmjs.com/package/havarotjs
MIT License
12 stars 4 forks source link

Syllable structure #114

Closed m-yac closed 1 year ago

m-yac commented 1 year ago

NB: This PR builds off #113 so should not be merged until the former is reviewed and/or merged.

This PR adds onset, nucleus, and coda methods to the Syllable class and appropriate tests to syllable.test.ts. These methods are exactly as described in #2 (with the exception that they return "" instead of null).

This PR also adds codaWithGemination, which includes gemination of the subsequent syllable in the coda. This is inspired by my comment in https://github.com/charlesLoder/hebrew-transliteration/discussions/68.

Note that currently the onset of the first syllable of שְׁתַּיִם is not "שְׁתּ", as it ought to be, since this library syllabifies שְׁתַּיִם as ["שְׁ", "תַּ", "יִם"].

Resolves #2

charlesLoder commented 1 year ago

I'm looking over this, and it's freaking amazing!

I'm gonna spend some time with it before merging just so I can grok it a bit.