phpSyllable icon indicating copy to clipboard operation
phpSyllable copied to clipboard

Not working ok in spanish

Open mariavilaro opened this issue 1 year ago • 2 comments

I'm trying very simple words in spanish and I get lots of errors. For example:

ma-r-tes (should be mar-tes) re-s-tar (should be res-tar) di-cie-m-bre (should be di-ciem-bre)

Is this a problem with phpSyllable or with the spanish patterns? I'm trying these same words here https://www.ushuaia.pl/hyphen/?ln=en (this resource is linked from https://hyphenation.org/) and they are hyphenated correctly.

mariavilaro avatar Dec 09 '24 18:12 mariavilaro

The ushuaia.pl implementation appears to prevent single-letter syllables. This is not part of the core algorithm.

It appears to incorrectly parse the Dutch (my native language) "diadeem" as "dia-deem" instead of the correct "di-a-deem".

Can you try Spanish words which should have single-letter syllables (if such even exist in that language). Perhaps an option could be added to prevent single-letter syllables.

vanderlee avatar Dec 10 '24 12:12 vanderlee

Yes, there are single letter syllables in spanish, but they can never be single consonants, only vocals. I tested and you are correct, ushuaia.pl parses them incorrectly, but phpSyllable also does it! So phpSyllable seems to prevent single vocal syllables, but not single consonant syllables. I tested with these words:

"día" = incorrect "día" (correct "dí-a") "abierto" = incorrect "abier-to" (correct "a-bier-to") "caótico" = incorrect "caó-ti-co" (correct "ca-ó-ti-co")

This website does it ok every time https://www.separarensilabas.com (you need to check the first option "Contar sílabas")

mariavilaro avatar Dec 10 '24 13:12 mariavilaro