Question: In Java Words from languages that we are unfamiliar with can be difficult to pronounce correctly. Phonetic pronunciation guides can help make them more accessible

In Java
Words from languages that we are unfamiliar with can be difficult to pronounce correctly. Phonetic pronunciation guides can help make them more accessible to us. For this problem, you will write a program that produces phonetic pronunciations for Hawaiian words.
Write a method getPronunciation that accepts a single String containing a potential Hawaiian word and returns a String containing the pronunciation guide. If the passed String is null or invalid, throw an IllegalArgumentException.
Hawaiian Characters
There are 12 valid characters in the Hawaiian language: a, e, i, o, u, p, k, h, l, m, n, and w. Each Hawaiian word passed into our program must be inspected to ensure it contains only these characters, because if it does not, then we dont have a valid Hawaiian word. If the passed word is not valid, throw an IllegalArgumentException. Note that you do not need to handle spaces or any other characters. You should ignore case when examining the input String, but your pronunciation guide output String should be all lowercase.
The consonants in the Hawaiian language are pronounced similarly to the English versions. The only exception is 'w', which is pronounced as a "v" if it follows an 'i' or 'e' and pronounced as "w" otherwise.
The vowels in the Hawaiian language are a, e, i, o, and u:
'a' sounds like "ah" like "aha"
'e' sounds like "eh" like "egg"
'i' sounds like "ee" like "bee"
'o' sounds like "oh" like "obey"
'u' sounds like "oo" like "mood"
Vowel groups are also present in the Hawaiian language. More complex words can have many vowels that when grouped together require additional rules. This means we can't simply replace all 'a's with "ah", and so on.
We will consider the following simplification of the Hawaiian vowel groups for this problem:
"ai" and "ae" sound like "eye"
"ao" and "au" sound like "ow"
"ei" sounds like "ay"
"eu" sounds like "eh-oo"
"iu" sounds like "ew"
"oi" sounds like "oy"
"ou" sounds like "ow"
"ui" sounds like "ooey"

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!