Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

list of words from a string and filter them based on a secondary list

common_words = frozenset(("if", "but", "and", "the", "when", "use", "to", "for"))
title = "When to use Python for web applications"
title_words = set(title.lower().split())
keywords = title_words.difference(common_words)
print(keywords)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #list #words #string #filter #based #secondary #list
ADD COMMENT
Topic
Name
1+1 =