Ask Computer Engineering Expert

Assignment: Linked Lists

In this assignment, you will be reading in words from a pronunciation dictionary to figure out which words rhyme with each other.

To do this, you will be implementing MyLinkedList and MySortedLinkedList. Besides the lectures in class, you can read much more about the code details of how linked lists work in the book on pages 249-268.

You'll be implementing the following:

? A linked list in MyLinkedList that implements interface . You'll be using in two different ways, to store a list of and to store a list of within each object. More on this below.

? Code in the main method of that takes lines that have been read from a rhyming dictionary and stores them in the lists.

? A subclass of MyLinkedList called MySortedLinkedList , that has a method for adding items into the list in sorted order.

? Code in the main method of RhymingDict that takes pairs of words specified on the command line and outputs whether they rhyme or not.

A LinkedList is useful for storing information when you don't know how many items you need to store. In this lab, we will be iterating through a rhyming dictionary and storing words together according to their rhyming group, which is the most heavily emphasized part of their pronunciation.

In the directory of starter code for the assignment, you'll see a subdirectory called cmudict . Inside is a file called cmudict- short .dict. Opening this, you'll see lines like:

The letters after the words represent the phonemes (units of sound) you speak when you pronounce the word. The phonemes that have numbers after them (0, 1 or 2) are the emphasized phonemes, with phonemes marked with 2 having the most emphasis (say the words out loud to yourself to try this out). Two words rhyme if the share the same subset of phonemes after the most emphasized phoneme. For example:

ListInterface
MyLinkedList
RhymeGroupWords
Strings
RhymeGroupWords
RhymingDict
dignitary D IH1 G N AH0 T EH2 R IY0

necessitate N AH0 S EH1 S AH0 T EY2 T

undue AH0 N D UW1

moderated M AA1 D ER0 EY2 T IH0 D

moderated M AA1 D ER0 EY2 T IH0 D

anticipated AE0 N T IH1 S AH0 P EY2 T IH0 D

both rhyme, and they both share EY2 T IH0 D starting with the most emphasized phoneme. The EY2 T IH0 D is called the rhyming group for these two words. You'll be storing rhyming groups in a linked list of RhymeGroupWords , a class you've been provided in the starter code. Each object stores a string with the rhyme group and a list of words that share the rhyme group (a variable of type ). So you'll be using linked lists in two different ways: to store a list of RhymeGroupWords , and, within each RhymeGroupWords object, to store a list of words.
RhymingDict

The file RhymingDict.java is provided for you. It already has the following:

RhymeGroupWords
getRhymeGroup(String line)

? A method from the dictionary. For example IH0 D" ) returns, which returns the rhyme group for a line, which returns the word for a line from the dictionary.

ListInterface

getRhymeGroup( "moderated M AA1 D ER0 EY2 T

? A method For example,

"EY2 T IH0 D"

getWord(String line)

getWord( "moderated M AA1 D ER0 EY2 T IH0 D" )

returns, which returns a S tring[] of all the lines from the

1. Use your implementation of MyLinkedList to create a linked list of RhymeGroupWords , one for each unique rhyme group you encounter (there are 8 unique rhyme groups in cmudict-short.dict ). Within each RhymeGroupWords you'll store a MySortedLinkedList of words that share that rhyme group.

2. Iterate through pairs of arguments to RhymingDict and use your linked list to determine if the pair of words rhyme. For example, with the command:

java RhymingDict crumbling mumbling collections abbreviated vegetate mutate

the output would be:

In the case of the last pair of words, and , since the word doesn't appear in cmudict-short.dict , it reports that and ignores "vegetate" . If an odd number of words is passed on the command line, it ignores the last word (since it's not part of a pair).

Do not use built-in Java data structures (like ArrayList or LinkedList) in this file

"moderated"

pronunciation dictionary.

loadDictionary()

? A method

The tasks you have to do is marked with the comment TODO in the main method of

EY2 T IH0 D

RhymingDict . These tasks are:

crumbling and mumbling rhyme

collections and abbreviated don't rhyme

mutate is not in the dictionary

"vegetate"
"mutate"
"mutate".

Attachment:- Assignment-Rhyming-Linked-List.rar

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92801369

Have any Question?


Related Questions in Computer Engineering

Does bmw have a guided missile corporate culture and

Does BMW have a guided missile corporate culture, and incubator corporate culture, a family corporate culture, or an Eiffel tower corporate culture?

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Jeff decides to start saving some money from this upcoming

Jeff decides to start saving some money from this upcoming month onwards. He decides to save only $500 at first, but each month he will increase the amount invested by $100. He will do it for 60 months (including the fir ...

Suppose you make 30 annual investments in a fund that pays

Suppose you make 30 annual investments in a fund that pays 6% compounded annually. If your first deposit is $7,500 and each successive deposit is 6% greater than the preceding deposit, how much will be in the fund immedi ...

Question -under what circumstances is it ethical if ever to

Question :- Under what circumstances is it ethical, if ever, to use consumer information in marketing research? Explain why you consider it ethical or unethical.

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

What type of economic system does norway have explain some

What type of economic system does Norway have? Explain some of the benefits of this system to the country and some of the drawbacks,

Among the who imf and wto which of these governmental

Among the WHO, IMF, and WTO, which of these governmental institutions do you feel has most profoundly shaped healthcare outcomes in low-income countries and why? Please support your reasons with examples and research/doc ...

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As