Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

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

After reading the article 10 techniques for gathering

After reading the article, 10 Techniques for Gathering Business Requirements, think about the following scenario and answer the questions provided. Wilmington University is implementing a mobile app where students are ab ...

All rsa cryptosystem has public key n 35 and e 7 messages

All RSA cryptosystem has public key N = 35 and e = 7. Messages are encrypted one letter at a time, converting letters to numbers by A = 2, B = 3, .... Z = 27, space = 28. Showing your working, encrypt the message: BE GOO ...

Give a recursive algorithm that generates a similar series

Give a recursive algorithm that generates a similar series of coins for changing n cents. Don't use dynamic programming for this problem.

Submit a 2- to 3-page paper in which youidentify an

Submit a 2- to 3-page paper in which you: Identify an intercultural area Intercultural interaction with a person from a culture different from your own. Explain why you have selected this area. Describe your personal cul ...

Can someone help please i had help but its not working

Can someone help please. I had help but it's not working. PLEASE DO BOTH PARTS! Please make sure to read the entire problem and do both parts PLEASE DO NOT write it out I have a hard time reading people's hand writing pl ...

Describe an ethical conundrum found in a magazine or

Describe an ethical conundrum found in a magazine or newspaper article, and please give your own thoughts. Give good citations, of course.

A small factory produces two types of toys trucks and

A small factory produces two types of toys: trucks and bicycles. In the manufacturing process two machines are used: the piece maker and the assembler. It takes 2 hours to make the pieces of the bicycles and 1 hour for t ...

Explain why a successful information security program is

Explain why a successful information security program is the shared responsibility of an organizations three communities of interest.

Explain a situation using the supply and demand for skilled

Explain a situation using the supply and demand for skilled labor in which the increased number of college graduates leads to depressed wages. Given the rising cost of going to college, explain why a college education wi ...

If we compare and contrast the four market structures it is

If we compare and contrast the four market structures, it is evident that one market structure is most practiced and evident in the United States. It is the one that promotes and strives on competition. It is the one tha ...

  • 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