Question: You are expected to write the specified functions accurately. These functions will take certain inputs as described. Your solution will be evaluated by running several

You are expected to write the specified functions accurately. These functions will take certain inputs as described. Your solution will be evaluated by running several test cases, including hidden tests. Note that it is forbidden to use loops, recursions and list methods (like .count(),.append() etc.).
You will use map, reduce and filter in your functions. Your program
should pass all of them to receive full credit. Use the given functions below:
Note: The read_file function expects the file to be in the same directory as the program; otherwise,
you must provide the full file path.
Required Functions:
my_info():
o Parameters: None.
o Functionality: This function should return a tuple containing your personal information
in the following order: Your student ID, your first name, your last name.
o Example: my_info() should return something like (123456, "John", "Doe").(Replace this
example with your actual student ID and name.)
count_word(string_list, word):
o Parameters:
string_list (list): A list of strings representing the text split into individual words.
word (str): The target word whose frequency you want to count.
o Functionality: This function calculates and returns the frequency of the specified word in
the given string_list. It uses the reduce function to iterate through the list and count
occurrences of the word. The comparison between words is case-insensitive, and
punctuation marks are stripped using a helper function called stem().
find_frequency(string_list, words):
o Parameters:
string_list (list): A list of strings representing the text split into individual words.
words (list): A list of target words whose frequencies you want to count.
o Functionality: This function calculates the frequency of each word in the words list by
calling the count_word() function for each word. It returns a list of frequencies
corresponding to the order of words in the words list. The map function is used to apply
count_word() to each word in the words list

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 Programming Questions!