| |
- eval_query(parsed_query_tree: search.advanced.query_parser.Node, data: parse.parse_html_tree.PopulateStructures)
- Method executes advanced search query and returns proper data structures
:param parsed_query_tree: advanced search query tree (defined in query_parser.py module)
:param data: PopulateStructures instance
:return: positive_query: string with searched words(excluding words after NOT operator)
hard_result_set: dict with file paths that satisfies constraints in query as keys and numbers of
appearances for every searched word in positive_query
broad_positive_res_set: dict with file paths as keys and numbers of appearances for every searched word
present in positive_query (sites present in hard_result_set are not included)
- evaluate(parsed_query_tree: search.advanced.query_parser.Node, data: parse.parse_html_tree.PopulateStructures)
- Method performs Postorder DFS on parsed_query_tree and constructs a Set for given advanced search.
:param parsed_query_tree: advanced search query tree
:param data: PopulateStructures instance
:return: resulting Set
- get_positive_list(parsed_query_tree: search.advanced.query_parser.Node, lst: list)
- FUNCTION IS MUTABLE.
:param parsed_query_tree: advanced search query tree
:param lst: destination list
:return: None
- get_set(word: str, trie: structures.trie.Trie)
- Performs search on one word query
:param word: string containing word to be searched
:param trie: PopulateStructures instance attribute containing Trie
:return: resulting Set
- get_world_set(html_files: list)
- :param html_files: list of all sites (usually PopulateStructures instance, attribute html_files)
:return: Set (structures.set module) structure of all sites
|