Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help reproducing transliteration scheme from Reconstructionist siddur? #85

Closed
inklesspen opened this issue May 31, 2024 · 1 comment
Closed

Comments

@inklesspen
Copy link

Hi, I am trying to sort out the right schema to match the transliteration used in the Reconstructionist siddur Kol Haneshamah. (It seems to be very similar to the SBL General Purpose schema.)

As an example:

אֵל הַי וְקַיָּם תָּמִיד יִמְלֹךְ עָלֵינוּ לְעוֹלָם וָעֶד׃

Is transliterated in the siddur as:

El ḥay vekayam tamid yimloḥ aleynu le'olam va'ed.

The item that I'm having particular difficulty is the apostrophe added between vowel sounds which should be pronounced separately. Possibly this is already implemented in the codebase but I don't know the right terminology to find it?

Here's my attempt at the schema (configured through the web interface): kh-schema.json

translit1
translit2

@charlesLoder
Copy link
Owner

@inklesspen

Thanks for this question!

I can think of two ways to get the results you need.

Postprocessing

Because the goal is to separate the Latin vowel characters, it may be best to process the transliterated text:

const transliteration = transliterate("אֵל חַי וְקַיָּם תָּמִיד יִמְלֹךְ עָלֵינוּ לְעוֹלָם וָעֶד׃", { customSchema });
// El ḥay vekayam tamid yimloḥ aleynu leolam vaed.

transliteration.split(" ").map(w => {
  const twoAdjacentVowels = /([aeiou])([aeiou])/g;
  return w.replaceAll(twoAdjacentVowels, "$1'$2");
}).join(" ");

// "El ḥay vekayam tamid yimloḥ aleynu le'olam va'ed."

Additional feature

An additional feature can be used with a callback like this:

const str = `אֵל חַי וְקַיָּם תָּמִיד יִמְלֹךְ עָלֵינוּ לְעוֹלָם וָעֶד׃`;

transliterate(str, {
  ...customSchema
  ADDITIONAL_FEATURES: [
    // if you customize your customSchema like I did here
    // don't forget the features you already have, or they will get overwritten
    {
      HEBREW: /[עא]/,
      FEATURE: "cluster",
      TRANSLITERATION: (cluster, _, schema) => {
        const syllable = cluster.syllable;
        const onset = syllable.onset;
        const clusterText = cluster.text;

        // this would mean that the alef or ayin do not contain a vowel
        if (onset != "ע" && onset != "א") {
          return clusterText;
        }

        // this would mean that there is no vowel preceding the alef or ayin, thus no need to add an apostrophe
        const prevSyllable = syllable.prev?.value;
        if (!prevSyllable) {
          return clusterText;
        }

        const key = onset === "ע" ? "AYIN" : "ALEF";

        return clusterText.replace(onset, "'" + schema[key]);
      }
    }
  ]
});

// el ḥay vekayam tamid yimloḥ alenu le'olam va'ed

The first is less integrated with the rules of the transliteration, but is probably easier to reason about. With the second, I imagine there are quite a few edge cases that could produce incorrect results.

I hope that helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants