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]
4 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]4 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
A doorknob is an example of which simple machine?
Zarrin [17]
A doorknob is an example of a:
D. Wheel and Axle. 
I hope this helped ^_^
3 0
3 years ago
Read 2 more answers
Assume your using a three button mouse to access shortcut menus you would
sergeinik [125]
Normally you would click the right hand/secondary mouse button, but you may configure any of the buttons to work within the Keyboard and Mouse section of the System Preferences, that can lead u to right clicking and it brings up a menu of the things that your possibly able to do .


 hOpe thiss theory hass helped you anyy :)
7 0
4 years ago
Suppose we are now working with memory words of length 8. We have already calculated that we need 4 check bits, and the length o
krok68 [10]

Answer:

12

Explanation:

and it is also an error

7 0
3 years ago
William is an HR manager in a textile-manufacturing firm. He is creating a file on the hours each employee worked during the las
Vika [28.1K]

The Round function will do the mentioned operation.

so answer is option C.ROUND

3 0
3 years ago
Read 2 more answers
What can I do with R?
mote1985 [20]
What are u asking???????
5 0
3 years ago
Other questions:
  • If 400 Pa of pressure is applied to an area of 55 m2, which is the resulting force?
    9·2 answers
  • SP 800-14, Generally Accepted Principles and Practices for Securing Information Technology Systems, provides best practices and
    12·1 answer
  • The control programs managing computer hardware and software perform the _________ function to control and prioritize tasks perf
    8·1 answer
  • A force of 50n acts on a body of mass 5kg. calculate acceleration produced .​
    14·1 answer
  • A look to different section of the same page is known as_____.
    7·1 answer
  • What is meant by usability and what characteristics of an interface are used to assess a system’s usability?
    15·1 answer
  • Using an outline, how do you maintain your computer or cellphone​
    8·1 answer
  • Any idea how to make my simple python projects such as guess the number, mad libs, etc. even better?
    15·2 answers
  • Which type of internet connection allows for high-speed bi-directional data communication over a hybrid fiber-coaxial (HFC) conn
    5·1 answer
  • How serious are the risks to your computer security?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!