Andy said:
Daniel said:
(e-mail address removed) wrote:
I'm pulling my hair out trying to figure out code for
parsing and counting syllables in simple English
sentences.
Can someone throw the dog a bone on where to start?
Google is your friend:
http://english.glendale.cc.ca.us/phonics.rules.html
<snip>
[..]
This web site
http://www.wordcalc.com/
seems to do what you want. Except... "The rhythm of life" contains two
syllables. Half a syllable per word.
Good luck. This is a hard problem.
Maybe from a linguistic point of view, it is hard. But algorithmically, it
seems somewhat easy: English has about 1,000,000 words (with very inclusive
counting) and the number of syllables in each of them is known. So just do a
table look-up. This algorithm also has the advantage of being applicable to
any language (and it will be easier as English has a huge vocabulary).
It's a finite problem and in fact smaller than, say, the problem of finding
phone numbers based on name and address. The interesting part would be to
use frequency information about words to make the look-up fast; or to find a
good data structure to reduce memory consumption.