Re: Splitting word based on syllables



Hi,

mayo_matt@xxxxxxxxxxx wrote:

Hi all,

I'll state up front that I am looking for HELP with an assignment...
not looking to get my work done for me at all. I am finishing up a
course in Prolog and AI, and while I am doing fairly well in the course
and grasping most things, I am stuck on one of the earlier assignment
questions.

I need to read a word in from the user and then split it into syllables
based on one of 2 rules: vowel-consonant-vowel, or
vowel-consonant-consonant-vowel, with the syllabic splits hopefully
intuitive to anyone reading this :)

What I figure I should be doing is reading in the word and then using
name to generate a list of ASCII chars. I should then read char by
char from the list and compare each char to a list of vowels. Once I
encounter a vowel I should then look a the next letter to see if it is
a consonant. A syllable will be formed based on the char that follows
this one (vowel next leads to one rule while consonant leads to the
other).

I really can't figure out how to implement this practically. THe
method I have laid out seems to make sens to me, but I cannot convert
it to code.

First of all, am I on the right track? And if I am, does anyone have a
suggestion of how to star this? If I am not on course, course someone
gently nudge me in the right direction?

I'd appreciate any input or considertation that anyone may have for me.
Thanks in advance.

Probably I can help you.

Use atom_chars to convert user input atom into list.
Then use append to split the list into randome parts.
Define a validator which can validate List's pieces according to
required rules.
end

Yours,
Advait

.



Relevant Pages

  • Re: Counting Chars Within Strings
    ... int vowel = 0; ... String String1 = "Event Handlers is dedicated to making your ... pos = String1.charAt; ... If you make sure pos contains a lower-case char, you could even just do "aeiou".indexOf... ...
    (comp.lang.java.programmer)
  • Re: Splitting word based on syllables
    ... Bill Spight wrote: ... I need to read a word in from the user and then split it into syllables ... char from the list and compare each char to a list of vowels. ... encounter a vowel I should then look a the next letter to see if it is ...
    (comp.lang.prolog)
  • Re: Splitting word based on syllables
    ... I need to read a word in from the user and then split it into syllables ... char from the list and compare each char to a list of vowels. ... encounter a vowel I should then look a the next letter to see if it is ... this one (vowel next leads to one rule while consonant leads to the ...
    (comp.lang.prolog)
  • Splitting word based on syllables
    ... I need to read a word in from the user and then split it into syllables ... char from the list and compare each char to a list of vowels. ... encounter a vowel I should then look a the next letter to see if it is ... this one (vowel next leads to one rule while consonant leads to the ...
    (comp.lang.prolog)