Description

Write a script called senticounter.py. Define a function run() inside senticounter.py.

The function should:

– Accept as a parameter the path to a text file. The text file has one review per line.

– Read the list of negative words from the negative-words.txt file.

– Create a dictionary that includes one key for each negative word that appears in the input text file. The dictionary should map each of these negative words to the number of times they appear immediately before the word “phone” in the entire file.

– Return the dictionary

Notes: Ignore case. You can also assume that the input file includes only letters, no punctuation or other special characters.