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 listpython/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

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!