- google.appengine.api.search.query_parser.GetPhraseQueryNodeText(node)source
Returns the text from a query node.
- google.appengine.api.search.query_parser.GetQueryNodeText(node)source
Returns the text from the node, handling that it could be unicode.
- google.appengine.api.search.query_parser.GetQueryNodeTextUnicode(node)source
Returns the unicode text from node.
- google.appengine.api.search.query_parser.IsPhrase(node)source
Return true if node is the root of a text phrase.
- google.appengine.api.search.query_parser.Parse(query)source
Parses a query and returns an ANTLR tree.
- google.appengine.api.search.query_parser.ParseAndSimplify(query)source
Parses a query and performs all necessary transformations on the tree.
- exception google.appengine.api.search.query_parser.QueryExceptionsource
Bases: exceptions.Exception
An error occurred while parsing the query input string.
- class google.appengine.api.search.query_parser.QueryLexerWithErrors(input=None, state=None)source
Bases: google.appengine.api.search.QueryLexer.QueryLexer
An overridden Lexer that raises exceptions.
- displayRecognitionError(tokenNames, e)source
- emitErrorMessage(msg)source
Raise an exception if the input fails to parse correctly.
Overriding the default, which normally just prints a message to stderr.
Parametersmsg – the error message
RaisesQueryException – always.
- class google.appengine.api.search.query_parser.QueryParserWithErrors(input, state=None)source
Bases: google.appengine.api.search.QueryParser.QueryParser
An overridden Parser that raises exceptions.
- displayRecognitionError(tokenNames, e)source
- emitErrorMessage(msg)source
Raise an exception if the input fails to parse correctly.
Overriding the default, which normally just prints a message to stderr.
Parametersmsg – the error message
RaisesQueryException – always.
- exception google.appengine.api.search.query_parser.QueryTreeException(msg, position)source
Bases: exceptions.Exception
An error occurred while analyzing the parse tree.
- google.appengine.api.search.query_parser.RemoveSurroundingQuotes(text)source
Removes outer quotation marks, if present.
- google.appengine.api.search.query_parser.SequenceToConjunction(node)source
Transform all SEQUENCE nodes into CONJUNCTION nodes.
Sequences have the same semantic meaning as conjunctions, so we transform them to conjunctions to make query matching code simpler.
Parametersnode – Root of the tree to transform.
ReturnsA tree with all SEQUENCE nodes replaced with CONJUNCTION nodes.
- google.appengine.api.search.query_parser.Simplify(parser_return)source
Simplifies the output of the parser.
- google.appengine.api.search.query_parser.SimplifyNode(node, restriction=None)source
- google.appengine.api.search.query_parser.ValidateNode(node)source
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-04-04 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-04-04 UTC."],[[["This module provides a wrapper for QueryParser, enabling the parsing and manipulation of search queries."],["It offers functions to create, parse, and simplify queries, including the conversion of nodes between different types."],["The module includes methods to extract text from query nodes, handling both standard and Unicode text."],["The `QueryLexerWithErrors` and `QueryParserWithErrors` classes are implemented to raise exceptions when parsing errors occur, providing error messages for failed parsing."],["It also handles the simplification of the query tree by converting SEQUENCE nodes into CONJUNCTION nodes, and removing surrounding quotation marks from text."]]],[]]