1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Len [333]
3 years ago
6

A file concordance tracks the unique words in a file and their frequencies. Write a program that displays a concordance for a fi

le. 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
Computers and Technology
1 answer:
neonofarm [45]3 years ago
3 0

Answer:

Python file with appropriate comments given below

Explanation:

#Take the input file name

filename=input('Enter the input file name: ')

#Open the input file

inputFile = open(filename,"r+")

#Define the dictionary.

list={}

#Read and split the file using for loop

for word in inputFile.read().split():

  #Check the word to be or not in file.

  if word not in list:

     list[word] = 1

  #increment by 1

  else:

     list[word] += 1

#Close the file.

inputFile.close();

#print a line

print();

#The word are sorted as per their ASCII value.

fori in sorted(list):

  #print the unique words and their

  #frequencies in alphabetical order.

  print("{0} {1} ".format(i, list[i]));

You might be interested in
Who is the father of computer​
r-ruslan [8.4K]

charles babbage is the father of computer's

3 0
3 years ago
Read 2 more answers
In 2009 to 2010, how many social network users were reported as being victims of online abuse?
Dafna1 [17]
The answer is B because being victims of online abuse is not important
7 0
3 years ago
Read 2 more answers
What is modem please give me answer​
rjkz [21]

Answer:

a combined device for modulations and demodulations

4 0
3 years ago
A customer has a system with a Gigabyte B450 Aorus Pro motherboard. He wants to upgrade the processor from the AMD Athlon X4 950
AleksandrR [38]
This upgrade will make a big improvement from his AMD Athalon X4 950 to the AMD Ryzen 7 2700X this is because the system will have more gigabytes and a better processor
3 0
3 years ago
Read 2 more answers
Whats your fav subject
kykrilka [37]

Answer:

Computers

Explanation:

Thats why I'm looking thru new on this subject

4 0
3 years ago
Read 2 more answers
Other questions:
  • Outline the steps necessary to prepare a storage device for storing files. Identify and briefly describe the tools used to prepa
    7·1 answer
  • How can I collect tweets from different accounts concurrently and categorize the tweets in a corpus?
    15·1 answer
  • _____________________ denotes the use of human interactions to gain any kind of desired access. Most often, this term involves e
    11·1 answer
  • How do you calculate the total resistance in a series circuit with more than one resistor?
    9·1 answer
  • What is abbreviation of the computer​
    15·2 answers
  • Please Help!
    13·1 answer
  • HELLO <br> any edmentum people out there.
    15·2 answers
  • How did hitles rules in nazi germany exemplify totiltarian rule?
    10·1 answer
  • You can use this keyboard shortcut to toggle the visibility of the command line. If for some reason your command line is hidden
    7·1 answer
  • Use HTML and CSS, create a web page for the table shown below. Please copy (and paste) your code from your text editor (Replit).
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!