Question: python/jupyter notebook please2 Write a function called filter_nonwords that takes a list of strings as input and returns a new list of strings that excludes
python/jupyter notebook please2
Write a function called filter_nonwords that takes a list of strings as input and returns a new list of strings that excludes anything that isn't entirely alphabetic. Use the str. isalpha( ) method to determine is a string is comprised o only alphabetic characters. text = '"Oh no, no," said the little Fly, "to ask me is in vain."' tokens = tokenize(text, do_lower=True) filter_nonwords(tokens) ['oh', 'no', 'no', 'said', 'the', 'little', 'fly', 'to', 'ask', 'me', 'is', 'in', 'v ain']
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
