Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The coding language for this question is Scala Objective 1: Rhyme Sounds In the Rhyming Dictionary object, write a method named is Rhyme Sounds that

The coding language for this question is Scalaimage text in transcribedimage text in transcribed

Objective 1: Rhyme Sounds In the Rhyming Dictionary object, write a method named is Rhyme Sounds that takes two Lists of Strings representing the sounds for two different words and returns a Boolean indicating whether or not the two words rhyme (ie. Return true if the words rhyme, false otherwise). In the tests package, complete the test suite named TestlsRhyme Sounds to test this method. Feedback Note Many homework objectives in this course will ask you to test your method with a test suite. When grading these objectives, your test suite will run against your own code, a correct solution, and a variety of incorrect solutions. The results (pass/fail) of your test suite on each solution will be provided You should ensure that your tests distinguish between all the correct and incorrect solutions before moving forward, but this does not always mean that your code is completely correct since there may be an error in your code that is not made by an incorrect solution, nor tested by your test suite. Additional testing may still be needed to complete the objective. The feedback in AutoLab is meant to help you, but it is not comprehensive If there is an error in any of your numbered objectives, even while correctly testing the correct/incorrect solutions, it will be difficult and frustrating to complete the primary objective. Be sure to thoroughly test your code and do not rely on AutoLab to test it for you Objective 2: Get Sounds In the Rhyming Dictionary object, write a method named getSounds that takes 2 Strings, the pronunciation dictionary filename, then a word and returns a List of Strings that are the sounds for that word from the pronunciation dictionary. If the word is not in the dictionary, return an empty List. In the tests package, complete the test suite named TestGetSounds to test this method. Objective 3: Rhyme Words In the Rhyming Dictionary object, write a method named isRhyme that takes 3 Strings, the pronunciation dictionary filename, then two words (Strings) and returns a Boolean indicating whether or not the two words rhyme (ie. Return true if the words rhyme, false otherwise). If either word is not in the dictionary, return false. In the tests package, complete the test suite named TestlsRhyme to test this method. Primary Objective In the Rhyming Dictionary object, write a method named findRhymes that takes two Strings as parameters and returns a List of Strings. The first input String represents the filename for the pronunciation dictionary. The second input String is a word for which you will find rhymes. Return a list containing all the words in the pronunciation dictionary that rhyme with the input word, including the input word itself. If the input word is not in the dictionary, return an empty list. You should use the methods you've written in the other 3 objectives to complete this primary objective. You should write tests for this objective, though you will not receive feedback regarding your tests for the primary objective. Note: Reading files is slow. If your program reads cmudict-0.7b -122,000 times (the number of words in the dictionary) when findRhyme is called it will take a very long time to run Objective 1: Rhyme Sounds In the Rhyming Dictionary object, write a method named is Rhyme Sounds that takes two Lists of Strings representing the sounds for two different words and returns a Boolean indicating whether or not the two words rhyme (ie. Return true if the words rhyme, false otherwise). In the tests package, complete the test suite named TestlsRhyme Sounds to test this method. Feedback Note Many homework objectives in this course will ask you to test your method with a test suite. When grading these objectives, your test suite will run against your own code, a correct solution, and a variety of incorrect solutions. The results (pass/fail) of your test suite on each solution will be provided You should ensure that your tests distinguish between all the correct and incorrect solutions before moving forward, but this does not always mean that your code is completely correct since there may be an error in your code that is not made by an incorrect solution, nor tested by your test suite. Additional testing may still be needed to complete the objective. The feedback in AutoLab is meant to help you, but it is not comprehensive If there is an error in any of your numbered objectives, even while correctly testing the correct/incorrect solutions, it will be difficult and frustrating to complete the primary objective. Be sure to thoroughly test your code and do not rely on AutoLab to test it for you Objective 2: Get Sounds In the Rhyming Dictionary object, write a method named getSounds that takes 2 Strings, the pronunciation dictionary filename, then a word and returns a List of Strings that are the sounds for that word from the pronunciation dictionary. If the word is not in the dictionary, return an empty List. In the tests package, complete the test suite named TestGetSounds to test this method. Objective 3: Rhyme Words In the Rhyming Dictionary object, write a method named isRhyme that takes 3 Strings, the pronunciation dictionary filename, then two words (Strings) and returns a Boolean indicating whether or not the two words rhyme (ie. Return true if the words rhyme, false otherwise). If either word is not in the dictionary, return false. In the tests package, complete the test suite named TestlsRhyme to test this method. Primary Objective In the Rhyming Dictionary object, write a method named findRhymes that takes two Strings as parameters and returns a List of Strings. The first input String represents the filename for the pronunciation dictionary. The second input String is a word for which you will find rhymes. Return a list containing all the words in the pronunciation dictionary that rhyme with the input word, including the input word itself. If the input word is not in the dictionary, return an empty list. You should use the methods you've written in the other 3 objectives to complete this primary objective. You should write tests for this objective, though you will not receive feedback regarding your tests for the primary objective. Note: Reading files is slow. If your program reads cmudict-0.7b -122,000 times (the number of words in the dictionary) when findRhyme is called it will take a very long time to run

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

Recommended Textbook for

Main Memory Database Systems

Authors: Frans Faerber, Alfons Kemper, Per-Åke Alfons

1st Edition

1680833243, 978-1680833249

More Books

Students also viewed these Databases questions

Question

How are the securities lending market regulated?

Answered: 1 week ago