Frage

I am writing a piece of code in c++ where in i need a word to syllable converter is there any open source standard algorithm available or any other links which can help me build one.

for a word like invisible syllable would be in-viz-uh-ble

it should be ideally be able to even parse complex words like "invisible".

I already found a link for algorithm in perl and python but i want to know if any library is available in c++

Thanks a lot.

War es hilfreich?

Lösung

Your example shows a phonetic representation of the word, not simply a split into syllables. This is a complex NLP issue.

Take a look at soundex and metaphone. There are C/C++ implementation for both.

Also many dictionaries provide the IPA notation of words. Take a look a Wiktionary API.

Andere Tipps

For detecting syllables in words, you could adapt a project of mine to your needs. It's called tinyhyphenator.

It gives you an integer list of all possible hyphenation indices within a word. For German it renders quite exactly. You would have to obtain the index list and insert the hyphens yourself.

By "adapt" I mean adding the specification of English syllables. Take a look at the source code, it is supposed to be quite self explanatory.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top