Question: In python: 3. A module speech_parser that contains a set of functions which can process a text file with a speech and write the results

In python:

3. A module speech_parser that contains a set of functions which can process a text file with a speech and write the results to the output file or to stdout. I leave it up to you to decide how to organize your functions inside that module, use your best judgement and the dont repeat yourself principle. However, the start function should have the following signature: parse_text( filename, write_to_file=False, output_filename=out.txt, ignore_file=ignore.txt, top=10)

Make sure you handle exceptions. Heres the example of how I can use the module:

import speech_parser parse_text(Roosevelt.txt) Will give the following output (in terminal, since I didnt set it to be a file): >>> Top-10 words in Roosevelt.txt are: >>> 1. national: 10 >>> 2. people: 9 >>> 3. may: 8 >>> 4. leadership: 7 >>> 5. action: 7 >>> 6. shall: 7 >>> 7. helped: 7 >>> 8. effort: 6 >>> 9. day: 6 >>> 10. from: 6

As you noticed, you need to have a file with words that you ignore (one word per line). My ignore.txt has the following contents: the, and, this, that, there, our, have, has, had, they, with, can, which, their, will, must, are, for, but, not, only, all, these, where, you,your. Requirements: Do not use any libraries other than sys and random (reduce is fine as well). Follow the PEP 8 style guide. (STRONGLY suggest using PyCharm) Variables, functions, files, and folders in your app must use the Snake case notation. All the import statements should be on top of a file. Please, use reasonable amount of comments to make your code clear.

In python: 3. A module speech_parser that contains a set of functions

Click here to Reply or Forward

Using 0.26 GB

Program PoliciesPowered by

Google

Last account activity: 1 minute ago

Open in 1 other location Details

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!