Question
Using PythonThe company quickly realized that the simple two-word thesaurus was far too small. In order to address this shortcoming they have provided you with
Using PythonThe company quickly realized that the simple two-word thesaurus was far too small. In order to address this shortcoming they have provided you with a very large text file that contains over 30,000 words. Copy this text-only thesaurus and save it in a file named python_asg10_Roget_Thesaurus.txt.
word1,synonym1,synonym2,...,synonymN-1,synonymNword2,synonym1,synonym2,...,synonymN-1,synonymNword3,synonym1,synonym2,...,synonymN-1,synonymNEvery word occupies its own line followed by a comma-separated list of synonyms. Every word can have a potentially unlimited # of synonyms. Your task for this part is to open this file and parse it into a Python dictionary object so that it functions just like the simple thesaurus from the previous part. Here's a sample running of your program: Total words in thesaurus: 33054
Enter a phrase: happy birthday said the sad kittenCONTENT ANNUAL HOLIDAY PRONOUNCED the DOLOROUS CHESHIRE CATHint: For each word you will need to create a new list that contains all the synonyms for that word. You can then store this list in the dictionary using the word as the key.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started