charlesLoder / havarotjs

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

Add `hasPrimaryAccent` and `hasSecondaryAccent` #140

Open charlesLoder opened 11 months ago

charlesLoder commented 11 months ago

As an example:

new Text("וַיֵּ֨לְכ֜וּ").syllables.map(s => {
  return {
    isAccented: s.isAccented,
    hasPrimaryAccent: s.hasPrimaryAccent,
    hasSecondaryAccent: s.hasSecondaryAccent
  }
});

/**
[
 {
    isAccented: true,
    hasPrimaryAccent: false,
    hasSecondaryAccent: true
  },
 {
    isAccented: true,
    hasPrimaryAccent: true,
    hasSecondaryAccent: false  
}
]
*/
charlesLoder commented 11 months ago

Maybe the qadma (also know as azla) always marks secondary stress?

https://github.com/charlesLoder/havarotjs/blob/0b27ff44cff235f22ce5da4e5bebd2408d4d1a3b/src/utils/syllabifier.ts#L367-L380

But that's not right...maybe

This has helpful information — https://jamesdprice.com/images/21_Syntax_of_Accents_rev._ed..pdf

charlesLoder commented 11 months ago

So pashta is always post-positive.

Maybe if there are two accents on a word, then the first marks secondary stress, unless the final is a pastha, which is post-positive

charlesLoder commented 4 months ago

Trying to use the accents is limiting. See Khan §1.2.8.2 for a treatment of stress. Though the discussion centers around the gaya, I think there is enough information there to figure something out.