From: Austin Ziegler Date: 2005-08-07T06:44:20+09:00 Subject: Re: STRING MANIPULATION: Marking syllables On 8/6/05, basi wrote: > How might one express the following syllabification rules: > 1. A c(c)v sequence is a syllable if followed by a cv sequence [...] > 2. A c(c)vc sequence is a syllable if followed by a c There are a couple of syntax (human language syntax) libraries mentioned on RAA; don't remember the names offhand. For hyphenation (not *quite* the same, mind you), you can always use Text::Hyphen. With a regexp, I'd do those as: # Note: this counts y as both vowel and consonant. This may not # always result in correct syllable identification. VOWELS = V = %r{[aieouy]}i CONSONANTS = C = %r{[b-df-hj-np-tv-z]}i c_opc_v = %r{#{C}#{C}?#{V}} c_opc_v_c = %r{#{C}#{C}?#{V}#{C}} There are other rules, I'm sure, because these two rules could be, at least theoretically, converted into c(c)v(c). -austin -- Austin Ziegler * halostatue@gmail.com * Alternate: austin@halostatue.ca