subject
Engineering, 18.12.2019 06:31 ethannila

Word freq dictionary: write a program that reads in a text file and counts instances of each word, recording those instances in a dictionary. then it should print out that information in a new file.

the program should:
read in each line from the input file
split each line into words by spaces
remove periods, question marks, commas, and periods from the end of each word using the string. strip method
remove quotation marks ('\'','"') from beginning and end of words
count the occurrences of the words using a dictionary
write out the dictionary information into a file in a consistent format (e. g., word: number, .tsv, .csv, etc.)

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Steel is coated with a thin layer of ceramic to protect against corrosion. what do you expect to happen to the coating when the temperature of the steel is increased significantly? explain.
Answers: 1
question
Engineering, 04.07.2019 18:10
Afour cylinder four-stroke in-line engine has a stroke of 160mm, connecting rod length of 150mm, a reciprocating mass of 3kg and its firing order is 1-3-4-2. the spacing between cylinders is 100mm. i. show that the engine is in balance with regard to the primary inertia forces and primary 3. a and secondary inertia couples. li determine the out of balance secondary inertia force ii. propose ways of balancing this out of balance force and discuss the challenges that will arise
Answers: 3
question
Engineering, 04.07.2019 18:10
Condition monitoring is a major component of. (clo4) a)- predictive maintenance. b)-preventive maintenance c)-proactive maintenance d)-reactive maintenance.
Answers: 1
question
Engineering, 04.07.2019 18:10
Which of the following controllers anticipates the future from the slope of errors over time? a)-proportional b)-on/off c)-integral d)-derivative.
Answers: 2
You know the right answer?
Word freq dictionary: write a program that reads in a text file and counts instances of each word,...
Questions
question
Computers and Technology, 04.08.2019 00:00
Questions on the website: 13722367