Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The purpose of this assignment is to gain familiarity with the dictionary ADT. A homophone is one of two or more words that are pronounced

The purpose of this assignment is to gain familiarity with the dictionary ADT. A homophone is one of two or more words that are pronounced alike but are different in meaning or spelling; for example, the words "two", "too", and "to".

Make a Java program that uses one of the implementations of the dictionary interface (UALDictionary or OALDictionary) to find all words that are homophones of an input word. Use only UALDictionary and/or OALDictionary, and do not use data structures that we have not covered so far in the course (meaning no hash maps). The file "cmudict.0.7a.txt" on Vocarem contains a pronunciation dictionary downloaded from http://www.speech.cs.cmu.edu/cgi-bin/cmudict .The page also contains a detailed description of the pronunciation dictionary. The file consists of lines of the form:

ABUNDANT AH0 B AH1 N D AH0 N T

The first string is the word, which is followed by one or more phonemes (or phones) that describe the pronunciation of the word. There are 39 phonemes occurring in North American English that are used in the dictionary. The collection of 39 symbols is known as the Arpabet, for the Advanced Research Projects Agency (ARPA), which developed it in the 1970's in connection with research on speech understanding. UALDictionary.java is a class that implements the dictionary interface using an unordered array list. OALDictionary is a class that implements the dictionary interface using an ordered array list. The array list stores (key, value) pairs as described in the class KVpair.java. Pronunciation.java is a class that stores and manages access to a (word, phonemes) pair. There is also a program Homophones.java that shows how you can read in the cmu dictionary (skipping comments and so on). You can modify that program so that when you read in a pronunciation entry you store it in an appropriate dictionary. Call your program AllHomophones. The input is a single word, in all upper case. The output is all words in the pronunciation dictionary that are homophones of the input word, including the input word, in alphabetical order. Both input and output should be all upper case since that is what the pronunciation dictionary uses.

For example, if the inout is

LAX

then the output should be:

LAC'S

LACKS

LAX

or

for input CARE

correct output is:

CAIRE

CARE

KAHRH

KEHR

OALDictionary: https://docs.google.com/document/d/1sCZJYf1PVTLNHORS2cy-gbIv4DjpikgeCBW3TzFEaaY/edit?usp=sharing

UALDictionary: https://docs.google.com/document/d/1sCZJYf1PVTLNHORS2cy-gbIv4DjpikgeCBW3TzFEaaY/edit?usp=sharing

Homophone: https://docs.google.com/document/d/1N6bzuTdH9nqtCCtGWfKBEf2vQwnuH3jX3Gs8ktEcUfM/edit?usp=sharing

KVpair: https://docs.google.com/document/d/1e1fVXuS7OxSGzlUfsAt9UmvnjTiN9HoCP5LeIVlok8U/edit?usp=sharing

Pronunciation: https://docs.google.com/document/d/1VkHxBe_IxrnfoQ6RELCkMQDus01e6_jXtjJQDFnyQJs/edit?usp=sharing

Dictionary: https://docs.google.com/document/d/19mBB77z1Vf2N8fSD9b2XUTX93W6XfcinB9Dv3vph0GI/edit?usp=sharing

cmudict.0.7a.txt: http://www.speech.cs.cmu.edu/cgi-bin/cmudict .

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 Programming questions

Question

\f

Answered: 1 week ago