Question: In this assignment, you are expected to write the specified functions accurately. These functions will take certain inputs as described. Your solution will be evaluated

In this assignment, 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.) in this assignment. 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:
```
def read_file(file_name:str):
with open(file_name, "r") as file:
content = file.read()
return content
def stem(word:str):
return word.lower().rstrip(",.!:;'-\"").Istrip("'\"")
```
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():
- Parameters: None.
- Functionality: This function should return a tuple containing your personal information in the following order: Your student ID, your first name, your last name.
- 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):
- 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.
- 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):
- 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.
- 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 appl count word() to each word in the words list. Submission and Grading:
- Test Cases:
- Your program will be evaluated against several test cases, some of which will be visible to you, and others will be hidden.
- Hardcoding solutions for visible test cases is strictly prohibited. If your program only works for the visible test cases through hardcoding, it will fail the hidden test cases and most likely receive a score of zero.
- After completing your solution in a file named "hw3.py", place it in the same directory as the provided "student_tester_3.py" file. Then, simply run "student_tester_3.py", which will automatically execute several test cases to check your functions. Passing both the visible and hidden test cases is required to receive full credit for the assignment.
- Grading Criteria:
- Programs that pass all test cases and obey the rules will receive full marks.
- Programs that fail test cases may be manually reviewed and could receive partial credit based on the level of correctness and effort. Incomplete or incorrect solutions may result in a score of zero.
- If AI detected in your assignment, you will get zero.
- If you do not write your own information in my info function, you will get zero.
- If you use forbidden methods, you will get zero.
Important Notes:
- Only upload your program file named "studentid_name_surname.py".
- Do not change function names.
- Your solution should include only function definition. Do not call functions in your program for the version you to upload.
- Use functional programming tools like map, reduce, and filter to handle operations on lists. It is not mandatory to use all of them for every function, but your solution should incorporate at least one where applicable.
- Avoid Hardcoding: Your solution should work for any valid input and must not rely on hardcode values for test cases. Solutions that are hardcoded to pass the visible test cases will fail hidden test cases and mav receive a score of zero
In this assignment, you are expected to write the

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!