Question: Problem 3 Define a function called tokenize(s) that satisfies the following criteria: - Tokenizes a string s into a list of words (based on seperation

 Problem 3 Define a function called tokenize(s) that satisfies the following

Problem 3 Define a function called tokenize(s) that satisfies the following criteria: - Tokenizes a string s into a list of words (based on seperation by any white space) - The returned tokens should contain only alphanumeric characters - The returned tokens should be suitable for caseless comparisons Hint: You may find it helpful to write a separate helper function for sanitizing the individual tokens. Examples: In : tokenize("Hello, world!") Out: ['hello', world'] In : tokenize("Hi! Hi! Who are you?") Out: ['hi', 'hi', 'who', 'are', 'you']

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!