Problem 2 (200pts): about
Implement about
, which takes a list of topic
words. It returns a function that can be passed to choose
as the select
argument. The returned function takes a paragraph and returns a boolean indicating whether that paragraph contains any of the words in topic
.
To make this comparison accurately, you will need to ignore case (that is, assume that uppercase and lowercase letters don't change what word it is) and punctuation.
Assume that all words in the topic
list are already lowercased and do not contain punctuation.
Hint: You may use the string utility functions in
utils.py
.
# Test your implementation
python ok -q 02