alexharri / beygla

Tiny (5kB gzipped) declension helper for Icelandic names.
MIT License
28 stars 2 forks source link

Do not apply declensions when they cannot apply to to the name #13

Closed alexharri closed 11 months ago

alexharri commented 11 months ago

What

The name "Maya" currently matches the declension for the name "Tanya" (the path to Tanya is "ya").

The declension for "Tanya" is 4;anya,önyu,önyu,önyu. The subtraction of 4 erases the entire name "Maya", given that it is only 4 character long, which is nonsensical.

This PR prevents Beygla from applying cases that cannot possibly apply.

How

If the nf ending does not match the provided name, do not apply the declension.