Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def keywordize(str):
"""
Splits a string into words, removes common stopwords, stems and removes
duplicates.
"""
import jellyfish
return set([jellyfish.porter_stem(word.lower().encode('ascii',
'ignore'))
for word in tokenize(str)
if (word.isalpha() or word.isdigit()) and
word.lower() not in stop_words])