PYTHON!!!!! A file concordance tracks the unique words in a file and their frequencies. Write a program that displays a concordance for a file. The program should output the unique words and their frequencies in alphabetical order. Variations are to track sequences of two words and their frequencies, or n words and their frequencies. Below is an example file along with the program input and output: example.txt I AM SAM I AM SAM SAM I AM Enter the input file name: example.txt AM 3 I 3 SAM 3 The program should handle input files of varying length (lines).     Program produces correct output given input, test 1 Test Case: Test program with example.txt   Input: example.txt   Results: AM 3 I 3 SAM 3         Program produces correct output given input, test 2 Test Case: Test program with test file 2 Input: test.txt     Results: 3/4 1 98 1 AND 2 GUARANTEED 1 INDEED 1 PERCENT 1 SUCCEED 1 WILL 2 YES 1 YOU 2

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter13: File Input And Output
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question
100%

PYTHON!!!!!

A file concordance tracks the unique words in a file and their frequencies. Write a program that displays a concordance for a file. The program should output the unique words and their frequencies in alphabetical order. Variations are to track sequences of two words and their frequencies, or n words and their frequencies.

Below is an example file along with the program input and output:

example.txt

I AM SAM I AM SAM SAM I AM

Enter the input file name: example.txt

AM 3

I 3

SAM 3

The program should handle input files of varying length (lines).

 

 

Program produces correct output given input, test 1

Test Case:

Test program with example.txt

 

Input:

example.txt

 

Results:

AM 3
I 3
SAM 3
 
 
 
 

Program produces correct output given input, test 2

Test Case:

Test program with test file 2

Input:
test.txt
 
 
Results:
3/4 1
98 1
AND 2
GUARANTEED 1
INDEED 1
PERCENT 1
SUCCEED 1
WILL 2
YES 1
YOU 2
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 6 steps with 5 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT