search_query.ebscohost.parser
EBSCO query parser.
Classes
|
Parser for EBSCO (list format) queries. |
|
Parser for EBSCO queries. |
- class search_query.ebscohost.parser.EBSCOListParser(query_list: str, field_general: str = '', ignore_failing_linter: bool = False)
Bases:
QueryListParserParser for EBSCO (list format) queries.
- linter: EBSCOListLinter
- class search_query.ebscohost.parser.EBSCOParser(query_str: str, *, field_general: str = '', offset: dict | None = None, original_str: str | None = None, silent: bool = False, ignore_failing_linter: bool = False)
Bases:
QueryStringParserParser for EBSCO queries.
- FIELD_REGEX = re.compile('\\b([A-Z]{2})\\b')
- LOGIC_OPERATOR_REGEX = re.compile('(?i:\\b(AND|OR|NOT)\\b)')
- OPERATOR_REGEX: re.Pattern = re.compile('(?i:\\b(AND|OR|NOT)\\b)|(?i:[NW]\\d+|(NEAR|N|WITHIN)/\\d+)')
- PARENTHESIS_REGEX = re.compile('[()]')
- PROXIMITY_OPERATOR_REGEX = re.compile('(?i:[NW]\\d+|(NEAR|N|WITHIN)/\\d+)')
- QUOTATION_MARK_REGEX = re.compile('"')
- TERM_REGEX = re.compile('[^\\s()"]+')
- fix_ambiguous_tokens() None
Fix ambiguous tokens that could be misinterpreted as a search field.
- parse_query_tree(tokens: list[Token], field_context: SearchField | None = None) Query
Top-down predictive parser for query tree.
- pattern = re.compile('[()]|(?i:\\b(AND|OR|NOT)\\b)|(?i:[NW]\\d+|(NEAR|N|WITHIN)/\\d+)|\\b([A-Z]{2})\\b|"|[^\\s()"]+')
- tokenize() None
Tokenize the query_str.