Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program pronounce.cpp that Lets the user input a word (lets call the input word W). If the word is not found in the

Write a program pronounce.cpp that Lets the user input a word (lets call the input word W). If the word is not found in the dictionary, print Not found. Otherwise, report: Pronunciation : the pronunciation of the word W (as given in the dictionary), Identical : other words from the dictionary with the same pronunciation as W, Add phoneme : words that can be obtained from W by adding one phoneme, Remove phoneme : words that can be obtained from W by removing one phoneme, Replace phoneme : words that can be obtained from W by replacing one phoneme. Write a program pronounce.cpp that Lets the user input a word (lets call the input word W). If the word is not found in the dictionary, print Not found. Otherwise, report:

Pronunciation : the pronunciation of the word W (as given in the dictionary),

Identical : other words from the dictionary with the same pronunciation as W,

Add phoneme : words that can be obtained from W by adding one phoneme,

Remove phoneme : words that can be obtained from W by removing one phoneme,

Replace phoneme : words that can be obtained from W by replacing one phoneme.

For dividing a string into words, we can give you a helper function, which receives a string argument s, and splits it into two strings on the very first space it finds within the string s: Example: "Fortune favors the bold" ? "Fortune" and "favors the bold". void splitOnSpace(string s, string & before, string & after) { // reset strings before = ""; after = ""; // accumulate before space int i = 0; while (i < s.size() && not isspace(s[i])) { before += s[i]; i++; } // skip the space i++; // accumulate after space while (i < s.size()) { after += s[i]; i++; } }

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

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions

Question

=+2. What are some of your racialized triggers?

Answered: 1 week ago