Question: Please use python or Pycharm code. When a program incorporates a large dictionary, the dictionary is usually created from a file, such as a text
Please use python or Pycharm code.
When a program incorporates a large dictionary, the dictionary is usually created from a file, such as a text file by using dict function to convert a list into a dictionary. Whenever a word in the original sentence is not a key in the dictionary, the get method places the word itself into the translated sentence. The file "Textese.txt" contains a word and its translation into textese. Make a program Translate.py to build a dictionary with the file, ask the user to enter a simple sentence then translate it into textese. You may have three functions: main(), createDictionary(filename) and translate(sentence, dictionary).
The file "Textese.txt" is as below:
adieu,u
anyone,ne1
are,r
ate,8
band,b&
be,b
before,b4
busy,bz
computer,puter
definitely,def
easy,ez
energy,nrg
enjoy,njoy
enough,nuff
everyone,every1
excellent,xlnt
favorite,fav
for,4
forever,4ever
forget,4get
great,gr8
in,n
late,l8
later,l8r
mate,m8
naturally,natch
oh,o
okay,k
one,1
please,plz
see,c
seriously,srsly
skate,sk8
skater,sk8r
someone,sum1
thanks,thx
to,2
today,2day
tomorrow,2mro
tonight,2nite
too,2
wait,w8
why,y
won,1
wonderful,1drfl
you,u
your,ur
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
