Program that replaces words with synonyms

Assignment Help Business Management
Reference no: EM132298626

1. You have been hired by a small software company to make a "thesaurus" program that replaces words with their synonyms. The company has set you up with a sample thesaurus stored in a Python dictionary object. Here's the code that represents the thesaurus:

# define our simple thesaurus

thesaurus = {

             "happy": "glad",

             "sad" : "bleak"

           }

The dictionary contains two keys - "happy" and "sad". Each of these keys holds a single synonym for that key.

Write a program that asks the user for a phrase. Then compare the words in that phrase to the keys in the thesaurus. If the key can be found, you should replace the original word with a random synonym for that word. Words that are changed in this way should be printed in

UPPERCASE

letters. Make sure to remove all punctuation from your initial phrase so that you can find all possible matches.

Here's the sample run of your program:

Enter a phrase: Happy Birthday! exclaimed the sad, sad kitten

GLAD birthday exclaimed the BLEAK BLEAK kitten

Comment your source code and describe your code to someone who may be viewing it for the first time.

Reference no: EM132298626

Questions Cloud

Draw a diagram for a non-deterministic finite : Draw a diagram for a non-deterministic finite state machine for the language L = { w e {a,b,c}* : w contains aabbcc}
Write a java program to input 4 values : After the data has been entered by the user, have your program output the values. Now output the values in reverse order.
Calculate the appropriate effect sizes for each tests : This time, assume the same 3 participants experience each of the 4 conditions: calculate the appropriate effect sizes for each of these three tests
Keep track of vendor email addresses : Using Python programmingYour company needs a way to keep track of vendor email addresses.
Program that replaces words with synonyms : You have been hired by a small software company to make a "thesaurus" program that replaces words with their synonyms. The company
Ethical issues in sport and law : MLC710 Sport and the Law - Deakin University - Assessment - Research Assignment: Critical Analysis and Reflection/Evaluation - specific legal issues
Agony of trying to unsubscribe : Can you relate to what James Veitch is talking about? How is your spam folder evidence for Veitch's arguments?
Remediation tie into information security maintenance : Describe how planning, risk assessment, vulnerability assessment, and remediation tie into information security maintenance
Personal computer name the backup solution : On your personal computer name the backup solution that you rely on the most. Why do you use that specific solution(s)?

Reviews

Write a Review

Business Management Questions & Answers

  Small corporation that owns as well as operates consumer

Mel is the president of a small corporation that owns as well as operates consumer electronics stores in several states throughout the country

  Organizational environment steady evolving

With the culture of today's organizational environment steady evolving, a contemporary approach to public management has replaced the historic theories once prevalent before. The purpose of management is to accomplish aims and objectives to ensure th..

  Project management practices and top management

Your company is ready to overhaul its project management practices and top management is convinced that it will benefit from adopting PMI standards in organizing and managing its projects and is encouraging all of its employees (including you and ..

  Identify factors that affect consumer buying decisions

Identify and understand the individual factors that affect consumer buying decisions. Individual factors that affect consumer buying decisions include gender;

  How it differs from a dial-up connection

Discuss what a broadband connection is, how it differs from a dial-up connection, and review the types of broadband connections.

  Company demonstrate social responsibility

In what ways should a company demonstrate social responsibility, ethical behavior, and good corporate/community citizenship?

  Analyze the leaders professional career track and growth

Analyze the leader's professional career track and growth, focusing specifically on leader's management roles and functions. How are the leader's leadership skills and abilities different from the management roles and functions he or she fulfilled..

  Provide a summary of the articles formatted as given

Provide a summary of the articles formatted as follows: 11 pitch Times Roman, One page, Double spaced and 1" margins.

  Six nursing units in a rehabilitation hospital

Assume that two nursing units are experiencing higher rates of patient falls than the other six nursing units in a rehabilitation hospital.

  Characteristics of a successful entrepreneur

Identify and briefly describe the key characteristics of a successful entrepreneur.

  Compare and contrast the behavior of negotiators

Compare and contrast the behavior of negotiators who enter a negotiation expecting fairness versus the behavior of negotiators

  How can obstacles be overcome to embrace change

What obstacles do new leadership styles face in traditional organizations? How can obstacles be overcome to embrace change?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd