DEV Community

Cover image for ItalianSyllabary is out!
Carlo Francesco
Carlo Francesco

Posted on

ItalianSyllabary is out!

Hi Guys!

My name is Carlo. I'm a Full Stack Web Developer that works in Sicily!

I'm excited about being part of Dev.to: I've found interesting content here, lot of ideas came to my mind thanks to you.

For my first post, I want to share my first little contribution to the open-source Community.

TL; DR;

I wrote a library that can help with the Syllabification in Italian since I did not find anything that helps with that online.

Here's a quick get started on how to use that in your C# code.

// Manual version with known issues
var syllabary = new ItalianSyllabary.ItalianSyllabary();
string[] syllables4Casa = syllabary.GetSyllables("casa").Result; // { "ca", "sa" }
string[] syllables4Manuale = syllabary.GetSyllables("manuale").Result; // { "ma", "nua", "le" }

// Online version, will fallback to manual if word is not found or is not italian
var syllabaryOnline = new ItalianSyllabary.ItalianSyllabary(preferOnline: true);
string[] syllablesOnline = syllabaryOnline.GetSyllables("manuale").Result; // { "ma", "nua", "le" }

Enter fullscreen mode Exit fullscreen mode

Limitations

While coding I encountered one of the problems that all of the tools that I tried online have that is: in Italian, the same name "Mario" and "Maria" has different Syllabifications.

The former is "Ma-rio" while the latter is "Ma-ri-a".

That's because of the accent "Màrio" and "Marìa"; you don't say Maria in a single breath.

Solution, Extension and contribute!

I built an enricher that gets word from a file (that is embedded into the source code so you don't have to navigate in the file system where the library is running, don't worry) and understand if it has accents to get the correct Syllabification.

And that's where you can contribute! If you want to help me, put words in the enricher, comment to tell me how you think this library can be useful, and thanks because you have read my first post!

References

You can find the library on Nuget here; links on Github here.

I hope to see you around!


Cover Photo by Brett Jordan on Unsplash

Top comments (0)