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

Add qamets qatan when 'kol' is by itself #102

Closed m-yac closed 1 year ago

m-yac commented 1 year ago

I noticed that the current qamets qatan regex for 'kol' doesn't handle the case when it is by itself (i.e. doesn't precede another word). This doesn't come up in practice, of course, but it did confuse me and make me think that the qamets qatan conversion didn't work when I typed in just "כָּל" as a test in hebrewtransliteration.app.

This PR makes the whitespace in that regex optional, which fixes this issue, and adds some tests.

(BTW I just found this project, it's amazing!)

charlesLoder commented 1 year ago

@m-yac

Wow, thanks!

This looks great, and a nice simple fix.

A user would definitely expect "כָּל" to have a qamets qatan.

For context, there are a few places where "כָּל" appears w/o a maqqef (e.g. Psa 35:10) and, if I remember correctly, reading traditions are split on how to pronounce it. Miqra acc. to the HaMasorah fixes this with a maqqef (Psa 35:10 again).

I'm glad you're finding it useful!

charlesLoder commented 1 year ago

The tests pass, but you'll have to run

npm run format

to fix the formatting issues