Search code examples
javastringwords

How to break a sentence into syllables in Java


Possible Duplicate:
Detecting syllables in a word

Assume the input string is "saya sedang makan nasi goreng" I want to break it into syllables: "sa", "ya", "se", "dang", "ma", "kan", "na", "si", "go", "reng"

How can I do it in Java? can somebody help me?


Solution

  • That's not an easy thing to do. But, if you still want to do it, I think your best bet is to search for a dictionary database (which gives you syllable breakdown for every word, though this is hard to find), download it and write a program to query the database and fetch the syllable breakup.