Question: JAVAJAVAJAVA Please write a method named isRhyme that takes two Strings as parameters and returns a boolean. This method returns true if the two input
"JAVA""JAVA""JAVA" Please write a method named "isRhyme" that takes two Strings as parameters and returns a boolean. This method returns true if the two input Strings rhyme according to the definition given above. It will return false if the words do not rhyme, or if either word is not in the dictionary. The case of the letters in the input words should be ignored 
The pronunciation dictionary provides the sounds for each word and each sound has a type. For the types we are only concemed if the sound is a vowel or not. All vowel sounds end with an integer that determines the stress given to that vowel and other sounds do not have this stress so a vowel can be identified by checking if a sound ends with an integer. Wel say that two words rhyme if all the sounds from the last vowel and after are the same. Words will rhyme even if the last vowel sounds have different stress. By defining a rhyme in this way we effectively consider two words to rhyme if their last syllable have the same sound, ignoring stress. For example all the following words from the dictionary will be considered rhymes since the last vowel is the same and all sounds after the last vowel are the same: HALF HH AE1 PHOTOGRAPH F OW1 T AHO G RAE2 F STAFF ST AE1 F LAUGH LAE1 F These words also all rhyme with each other: THOUSAND TH AW1 Z AHO N D DIAMOND DAY1 M AHON D FUND F AH1ND AND AHO ND SECOND S EH1 KAHOND ISLAND AY1 L AHOND LEGEND LEH1 JH AHOND The pronunciation dictionary provides the sounds for each word and each sound has a type. For the types we are only concemed if the sound is a vowel or not. All vowel sounds end with an integer that determines the stress given to that vowel and other sounds do not have this stress so a vowel can be identified by checking if a sound ends with an integer. Wel say that two words rhyme if all the sounds from the last vowel and after are the same. Words will rhyme even if the last vowel sounds have different stress. By defining a rhyme in this way we effectively consider two words to rhyme if their last syllable have the same sound, ignoring stress. For example all the following words from the dictionary will be considered rhymes since the last vowel is the same and all sounds after the last vowel are the same: HALF HH AE1 PHOTOGRAPH F OW1 T AHO G RAE2 F STAFF ST AE1 F LAUGH LAE1 F These words also all rhyme with each other: THOUSAND TH AW1 Z AHO N D DIAMOND DAY1 M AHON D FUND F AH1ND AND AHO ND SECOND S EH1 KAHOND ISLAND AY1 L AHOND LEGEND LEH1 JH AHOND
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
