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

Create flexible "ketiv/qere" features #170

Closed charlesLoder closed 1 week ago

charlesLoder commented 4 months ago

Create a syllabification option that allows for ketiv/qere like options. See initial discussion.

Users should be able to give an input (the ketiv) and the .text property should be the output (the qere). Example:

const text = new Text("הִ֖וא בֵּֽית־אֵ֑ל ה֖וּא וְכׇל־הָעָ֥ם אֲשֶׁר־עִמּֽוֹ׃", {
    ketivQeres: [
        {
            input: "הִוא",
            output: "הִ֖וא",
            ignoreTaamim: true // idk about this settings
        }
    ]    
});

text.word[0].original // הִ֖וא
text.word[0].text // הִ֖וא

Input should be a string or regex, and output should be a string or function. The ignoreTaamim option could be useful — it should default to true though.

Performance should be taken into consideration too