querying module¶
-
class
querying.
ExtendedPorterStemmer
¶ Bases:
core.queries.porter.PorterStemmer
Extends the porter stemmer with a stem_words method.
-
stem_words
(words)¶ stems each token in list of tokens :param words :return: list of stemmed tokens
-
-
querying.
simple_search
(stemmer, token_index, queries, multi_query_mode=False)¶ Default search, finds results on each token, applies logic based on the query then represents the results based on their tf-idf score. :param stemmer: :param token_index: tokenindex :param queries: :param multi_query_mode: :return:
-
querying.
sort_query
(query, default_op=':and:')¶ sorts a query based on the boolean priorities. :param: testing :or: not something :not: hype :or: random :not: python :return: [‘something’, ‘:and:’, ‘testing’, ‘:or:’, ‘not’, ‘:or:’, ‘random’, ‘:not:’, ‘hype’, ‘:not:’, ‘python’]