(query)
return filtered_query if len(filtered_query) else split_query
Filter out stopwords but only if there are useful words
Filter out stopwords but only if there are useful words
Filter out stopwords but only if there are useful words
def split_text_query(query):
    """Filter out stopwords but only if there are useful words"""

    split_query = list(smart_split(query))
    filtered_query = [bit for bit in split_query if bit not in STOPWORDS]

    return filtered_query if len(filtered_query) else split_query
def split_text_query ( query ) : split_query = list ( smart_split ( query ) ) filtered_query = [ bit for bit in split_query if bit not in STOPWORDS ] return filtered_query if len ( filtered_query ) else split_query