Question: Problem 0 2 ( Text Analysis ) ( 2 0 points ) Write a program that reads text from two text files and write to
Problem Text Analysis points
Write a program that reads text from two text files and write to an output file:
List of all the unique words contained in the first file.
List of all the unique words contained in the second file.
List of all the unique words contained in both files.
List of the words that appear in both files.
List of the words that appear in the first file but not the second file.
List of the words that appear in the second file but not the first file.
List of the words that appear in either the first or second file but not both files.
Frequency table of words counts in each file
The program should have the following functions:
a A function to write data from a list to a file
b A function that creates a list of unique words from a file and returns it
c A function that creates a list of union of words in two files and returns it
d A function that creates a list of common words in two files and returns it
e A function that creates a list of words in one file but not in another file and returns it
f A function that prints in tabular format the count of each word in a file.
g Main function to call all the above functions.
h A function to read data from a file and returns a list of words in a file
Make sure you remove punctuations at the end of each word. Do not Use set operations to perform the above analyses.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
