java.lang.Object
| +--Word
public class Word
extends Object
The Word class represents a single word. It provides a method to count the number of syllables in the word as well as a convenient method that determines if a particular character is a vowel.
|
|
|
|
Method Summary |
|
|
|
|
|
|
|
|
Methods inherited from class java.lang.Object |
|
|
public Word(String w)
Construct a new Word based on the parameter w.
w - the
String which constitutes the new word.
public int countSyllables()
· "simplicity" contains 4 syllables.
· "group" contains 1 syllable.
· "keeping" contains 2 syllables.
· "syllable" contains 2 syllables.
All non-letter's such as digits and punctuation should be treated as non-vowels. For example:
· "testing123" counts as 2 syllables.
· "What?" counts as 1 syllable.
· "pqr132" counts as 1 syllable.
· "X=227-314" counts as 1 syllable.
the number of syllables in this Word.
Determine if ch is a vowel. Vowels are considered to be
"AEIOUY" and "aeiouy". true if ch is a vowel and false if
it is not a vowel.
isVowel
public static boolean isVowel(char ch)
ch - the character to be checked.