Syllables

Q&A's, tips, howto's

Syllables

Postby kanen » Sun Sep 07, 2014 7:59 pm

I'm doing something which requires me to understand how many syllables are in a word I've retrieved.

Anyone have any experience figuring this out in newLisp?
. Kanen Flowers http://kanen.me .
kanen
 
Posts: 145
Joined: Thu Mar 25, 2010 6:24 pm

Re: Syllables

Postby rickyboy » Sun Sep 07, 2014 8:54 pm

Kanen,

To answer your question, no. But, assuming you mean English words and you want a purely algorithmic approach, it looks like the best you can do it is by heuristic. The first (highest voted answer) on this stackoverflow post has a link to the TeX hyphenation algorithm. That looks pretty promising.

Also, maybe there is an on-line dictionary of English words that are already hyphenated to which you could appeal (i.e. have a lookup table).

Good luck, man!
(λx. x x) (λx. x x)
rickyboy
 
Posts: 584
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Re: Syllables

Postby ralph.ronnquist » Sun Sep 07, 2014 10:49 pm

If you are looking at syllables in terms of sound (rather than the hyphenation problem), you might do something fun with
http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict.0.7a
which is an english phonetic dictionary (copyright CMU). You'll probably need to compound certain phoneme series into syllables before counting.
ralph.ronnquist
 
Posts: 204
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia

Re: Syllables

Postby rickyboy » Sun Sep 07, 2014 10:57 pm

Looks like that could be made into a nice lookup table. It's easy to see the pronounced vowel sounds (in the code) and count them. That count should equal the syllable count. Nice find, Ralph!
(λx. x x) (λx. x x)
rickyboy
 
Posts: 584
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Re: Syllables

Postby kanen » Mon Sep 08, 2014 9:52 pm

You guys are very helpful. With a little training and some newLisp magic, I figured it out and created a giant table from my results.

Code: Select all
(set 'phonetics '(
  ("AABERG" 2)
  ("AACHEN" 2)
  ("AACHENER" 3)
  ("AAKER" 2)
  ("AALSETH" 2)
  ("AAMODT" 2)
  ("AANCOR" 2)
  ("AARDEMA" 3)
  ("AARDVARK" 2) ... )
. Kanen Flowers http://kanen.me .
kanen
 
Posts: 145
Joined: Thu Mar 25, 2010 6:24 pm

Re: Syllables

Postby Lutz » Mon Sep 08, 2014 11:17 pm

… now with the phonetics association list, you can quickly create a context for lookup:

Code: Select all
> (new Tree 'Syllables)
Syllables
> (Syllables phonetics)
Syllables
> (Syllables "AARDEMA")
3
>


see also here: http://www.newlisp.org/downloads/newlis ... .html#hash
Lutz
 
Posts: 5276
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California


Return to newLISP in the real world

Who is online

Users browsing this forum: No registered users and 1 guest

cron