Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

**TO BE DONE IN PYTHON LANGUAGE For names of the input files - you can hard code it in a list, and then process them

**TO BE DONE IN PYTHON LANGUAGE

For names of the input files - you can hard code it in a list, and then process them one by one. Or you can name the files as FILE1.txt to FILEn.txt, and take an integer input regarding the number of files and then read them. You need to write out the output files in this directory itself.

To score an answer file first determine:

F1 factor = (Unique words/Total words)

F2 factor = (total occurrences the top 5 most occurring words)/Total words

F3 factor = (number of sentences >35 words or < 5 words)/Total sentences

F4 factor = (Frequency of consecutive [comma+full-stop+colon+semicolon]/Total words)

F5 factor = 1 if (Total word count > 750 words), else 0.

Net score is: 4 + F1*6 + F2*6 -F3 - F4 - F5.

Some clarifications:

The total sentence count needs to be computed after discounting repeated full stops.( For example - I am a student )Here, there are a few consecutive full-stops. We will, however, consider this as a single sentence. And increase the count of consecutive full-stops/ commas/ semi-colons/ colons /hyphens by one regardless of how many full-stops there are (.. is one and .. is also one, so is .,.,.,).

Consider words of the same spelling but different cases as the same word.

Output is to be written in the file scores.txt , as follows:

Write the filename on one line.

On the next line, write the student's score with the text score: [without quotes].

On the next line, write out the five most used words in descending order of usage.

On the next line, write out five randomly selected words from the submission.

(Points 3 and 4 help to see whether the assignment submission is valid, by checking whether the words are actual English words or not. Your program does not have to check whether these are English words - this explanation is given just to tell you why points 3 and 4 are to be done.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Internals A Deep Dive Into How Distributed Data Systems Work

Authors: Alex Petrov

1st Edition

1492040347, 978-1492040347

More Books

Students also viewed these Databases questions

Question

List the functional consequences of PTSD.

Answered: 1 week ago