search_query.pubmed.linter
Pubmed query linter.
Classes
| 
 | Linter for PubMed Query Strings | 
| 
 | Linter for PubMed Query Strings | 
- class search_query.pubmed.linter.PubmedQueryListLinter(parser: PubmedListParser, string_parser_class: Type[QueryStringParser], ignore_failing_linter: bool = False)
- Bases: - QueryListLinter- Linter for PubMed Query Strings - OPERATOR_NODE_REGEX = re.compile('#?\\d+|AND|OR|NOT')
 - validate_tokens() None
- Validate token list 
 
- class search_query.pubmed.linter.PubmedQueryStringLinter(query_str: str = '', *, original_str: str | None = None, silent: bool = False, ignore_failing_linter: bool = False)
- Bases: - QueryStringLinter- Linter for PubMed Query Strings - PROXIMITY_REGEX = re.compile('^\\[(.+):~(.*)\\]$')
 - VALID_TOKEN_SEQUENCES: Dict[TokenTypes, List[TokenTypes]] = {TokenTypes.FIELD: [TokenTypes.LOGIC_OPERATOR, TokenTypes.PARENTHESIS_CLOSED, TokenTypes.RANGE_OPERATOR], TokenTypes.LOGIC_OPERATOR: [TokenTypes.TERM, TokenTypes.PARENTHESIS_OPEN], TokenTypes.PARENTHESIS_CLOSED: [TokenTypes.LOGIC_OPERATOR, TokenTypes.PARENTHESIS_CLOSED], TokenTypes.PARENTHESIS_OPEN: [TokenTypes.TERM, TokenTypes.PARENTHESIS_OPEN], TokenTypes.RANGE_OPERATOR: [TokenTypes.TERM], TokenTypes.TERM: [TokenTypes.FIELD, TokenTypes.LOGIC_OPERATOR, TokenTypes.PARENTHESIS_CLOSED]}
 - YEAR_VALUE_REGEX = re.compile('^"?(?P<year>\\d{4})(?P<month>\\/(0[1-9]|1[0-2]))?(?P<day>\\/(0[1-9]|[12]\\d|3[01]))?(\\:(?P<year2>(\\d{4})(?P<month2>\\/(0[1-9]|1[0-2]))?(?P<day2>\\/(0[1-9]|[12]\\d|3[01]))?))?"?$', re.VERBOSE)
 - add_artificial_parentheses_for_operator_precedence(index: int = 0, output: list | None = None) tuple[int, list[Token]]
- Adds artificial parentheses with position (-1, -1) to enforce PubMed operator precedence. 
 - check_implicit_fields() None
- Check the general search field 
 - check_invalid_proximity_operator() None
- Check search field for invalid proximity operator 
 - check_invalid_syntax() None
- Check for invalid syntax in the query string. 
 - check_invalid_token_sequences() None
- Check token list for invalid token sequences. 
 - check_unsupported_pubmed_fields() None
- Check for the correct format of fields. 
 - syntax_str_to_generic_field_set(field_value: str) set
- Translate a search field