Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Write a hypothetical post - phishing exploitation scenario.

Answered: 1 week ago

Question

(a) There are five factors (A, B, C, D, and E). Pg45

Answered: 1 week ago

Question

The amount of work I am asked to do is reasonable.

Answered: 1 week ago

Question

The company encourages a balance between work and personal life.

Answered: 1 week ago