Class RankingExpressionParser
java.lang.Object
com.yahoo.searchlib.rankingexpression.parser.RankingExpressionParser
- All Implemented Interfaces:
RankingExpressionParserConstants
-
Field Summary
FieldsModifier and TypeFieldDescriptionNext token.Current token.Generated Token Manager.Fields inherited from interface com.yahoo.searchlib.rankingexpression.parser.RankingExpressionParserConstants
ABS, ACOS, ADD, AND, APPROX, ARGMAX, ARGMIN, ASIN, ATAN, ATAN2, AVG, BIT, CEIL, CELL_CAST, COLON, COMMA, CONCAT, COS, COSH, COSINE_SIMILARITY, COUNT, DECIMAL, DEFAULT, DIAG, DIV, DOLLAR, DOT, ELU, EOF, EQUAL, ERF, EUCLIDEAN_DISTANCE, EXP, EXPAND, EXPONENT, F, FABS, FALSE, FLOAT, FLOOR, FMOD, GREATER, GREATEREQUAL, HAMMING, HEX, IDENTIFIER, IF, IN, INTEGER, ISNAN, JOIN, L1_NORMALIZE, L2_NORMALIZE, LBRACE, LCURLY, LDEXP, LESS, LESSEQUAL, LOG, LOG10, LSQUARE, MAP, MATMUL, MAX, MEDIAN, MERGE, MIN, MOD, MUL, NOT, NOTEQUAL, OCTAL, OR, POW, POWOP, PROD, RANDOM, RANGE, RBRACE, RCURLY, REDUCE, RELU, RENAME, ROUND, RSQUARE, SIGMOID, SIGN, SIN, SINGLE_LINE_COMMENT, SINH, SOFTMAX, SQRT, SQUARE, STRING, SUB, SUM, TAN, TANH, TENSOR, tokenImage, TRUE, XW_PLUS_B -
Constructor Summary
ConstructorsConstructorDescriptionConstructor with generated Token Manager.RankingExpressionParser(InputStream stream, String encoding) Constructor with InputStream and supplied encodingRankingExpressionParser(Reader stream) Constructor with InputStream. -
Method Summary
Modifier and TypeMethodDescriptionfinal List<ExpressionNode>args()final Functionfinal Operatorfinal ExpressionNodeconstantPrimitive(boolean negate) final com.yahoo.tensor.functions.Slice.DimensionValuedimensionValue(Optional dimensionName) final voidDisable tracing.final doublefinal voidEnable tracing.final ExpressionNodefinal List<ExpressionNode>final ReferenceNodefeature()final List<ReferenceNode>final ExpressionNodefunction()Generate ParseException.final Tokenfinal TokengetToken(int index) final Stringfinal IfNodefinal Listfinal voidindexedTensorCellSubspace(List cells) final voidfinal com.yahoo.tensor.functions.DynamicTensorindexedTensorValueBody(com.yahoo.tensor.TensorType type, List dimensionOrder) final intfinal voidfinal voidkeyValueOrMixedBlock(com.yahoo.tensor.TensorType type, List dimensionOrder, Map cellMap) final Stringlabel()final voidlabelAndDimension(com.yahoo.tensor.TensorAddress.Builder addressBuilder) final voidlabelAndDimensionValues(List addressValues) final LambdaFunctionNodefinal ReferenceNodefinal com.yahoo.tensor.functions.DynamicTensormappedTensorValueBody(com.yahoo.tensor.TensorType type) final voidmixedBlock(com.yahoo.tensor.TensorType type, List dimensionOrder, Map cellMap) final com.yahoo.tensor.functions.DynamicTensormixedTensorValueBody(com.yahoo.tensor.TensorType type, List dimensionOrder) final ExpressionNodefinal com.yahoo.tensor.TensorType.Valuefinal Stringout()final Stringouts()final ExpressionNodevoidReinitialisevoidReInit(InputStream stream, String encoding) ReinitialisevoidReinitialisefinal FunctionNodefinal Stringstring()final Stringtag()final TensorFunctionNodefinal TensorFunctionNodefinal voidtensorCell(com.yahoo.tensor.TensorType type, Map cells) final TensorFunctionNodefinal TensorFunctionNodefinal TensorFunctionNodefinal TensorFunctionNodefinal TensorFunctionNodefinal TensorFunctionNodefinal TensorFunctionNodefinal Stringfinal TensorFunctionNodefinal TensorFunctionNodetensorGenerateBody(com.yahoo.tensor.TensorType type) final TensorFunctionNodefinal TensorFunctionNodefinal TensorFunctionNodefinal TensorFunctionNodefinal TensorFunctionNodefinal TensorFunctionNodefinal TensorFunctionNodefinal TensorFunctionNodefinal TensorFunctionNodefinal com.yahoo.tensor.functions.Reduce.Aggregatorfinal TensorFunctionNodefinal TensorFunctionNodefinal TensorFunctionNodefinal com.yahoo.tensor.TensorTypetensorType(List dimensionOrder) final voidtensorTypeDimension(com.yahoo.tensor.TensorType.Builder builder, List dimensionOrder) final TensorFunctionNodetensorValueBody(com.yahoo.tensor.TensorType type, List dimensionOrder) final TensorFunctionNodefinal booleanfinal Functionfinal ExpressionNodevalue()final ListA tensor address (possibly on short form) represented as a list because the tensor type is not available
-
Field Details
-
token_source
Generated Token Manager. -
token
Current token. -
jj_nt
Next token.
-
-
Constructor Details
-
RankingExpressionParser
Constructor with InputStream and supplied encoding- Parameters:
stream- input streamencoding- charset to be used. May not benull.
-
RankingExpressionParser
Constructor with InputStream.- Parameters:
stream- char stream
-
RankingExpressionParser
Constructor with generated Token Manager.- Parameters:
tm- Token manager to use
-
-
Method Details
-
featureList
- Throws:
ParseException
-
rankingExpression
- Throws:
ParseException
-
expression
- Throws:
ParseException
-
operationExpression
- Throws:
ParseException
-
binaryOperator
- Throws:
ParseException
-
value
- Throws:
ParseException
-
ifExpression
- Throws:
ParseException
-
feature
- Throws:
ParseException
-
legacyQueryFeature
- Throws:
ParseException
-
outs
- Throws:
ParseException
-
out
- Throws:
ParseException
-
args
- Throws:
ParseException
-
function
- Throws:
ParseException
-
scalarOrTensorFunction
- Throws:
ParseException
-
tensorFunction
- Throws:
ParseException
-
tensorMap
- Throws:
ParseException
-
tensorReduce
- Throws:
ParseException
-
tensorReduceComposites
- Throws:
ParseException
-
tensorJoin
- Throws:
ParseException
-
tensorMerge
- Throws:
ParseException
-
tensorRename
- Throws:
ParseException
-
tensorConcat
- Throws:
ParseException
-
tensorGenerate
- Throws:
ParseException
-
tensorGenerateBody
public final TensorFunctionNode tensorGenerateBody(com.yahoo.tensor.TensorType type) throws ParseException - Throws:
ParseException
-
tensorRange
- Throws:
ParseException
-
tensorDiag
- Throws:
ParseException
-
tensorRandom
- Throws:
ParseException
-
tensorL1Normalize
- Throws:
ParseException
-
tensorL2Normalize
- Throws:
ParseException
-
tensorEuclideanDistance
- Throws:
ParseException
-
tensorCosineSimilarity
- Throws:
ParseException
-
tensorMatmul
- Throws:
ParseException
-
tensorSoftmax
- Throws:
ParseException
-
tensorXwPlusB
- Throws:
ParseException
-
tensorExpand
- Throws:
ParseException
-
tensorArgmax
- Throws:
ParseException
-
tensorArgmin
- Throws:
ParseException
-
tensorCellCast
- Throws:
ParseException
-
lambdaFunction
- Throws:
ParseException
-
tensorReduceAggregator
public final com.yahoo.tensor.functions.Reduce.Aggregator tensorReduceAggregator() throws ParseException- Throws:
ParseException
-
tensorType
- Throws:
ParseException
-
optionalTensorValueTypeParameter
public final com.yahoo.tensor.TensorType.Value optionalTensorValueTypeParameter() throws ParseException- Throws:
ParseException
-
tensorTypeDimension
public final void tensorTypeDimension(com.yahoo.tensor.TensorType.Builder builder, List dimensionOrder) throws ParseException - Throws:
ParseException
-
tensorFunctionName
- Throws:
ParseException
-
unaryFunctionName
- Throws:
ParseException
-
binaryFunctionName
- Throws:
ParseException
-
expressionList
- Throws:
ParseException
-
doubleNumber
- Throws:
ParseException
-
integerNumber
- Throws:
ParseException
-
identifier
- Throws:
ParseException
-
identifierList
- Throws:
ParseException
-
bracedIdentifierList
- Throws:
ParseException
-
tag
- Throws:
ParseException
-
tagCommaLeadingList
- Throws:
ParseException
-
constantPrimitive
- Throws:
ParseException
-
tensorValueBody
public final TensorFunctionNode tensorValueBody(com.yahoo.tensor.TensorType type, List dimensionOrder) throws ParseException - Throws:
ParseException
-
mappedTensorValueBody
public final com.yahoo.tensor.functions.DynamicTensor mappedTensorValueBody(com.yahoo.tensor.TensorType type) throws ParseException - Throws:
ParseException
-
mixedTensorValueBody
public final com.yahoo.tensor.functions.DynamicTensor mixedTensorValueBody(com.yahoo.tensor.TensorType type, List dimensionOrder) throws ParseException - Throws:
ParseException
-
indexedTensorValueBody
public final com.yahoo.tensor.functions.DynamicTensor indexedTensorValueBody(com.yahoo.tensor.TensorType type, List dimensionOrder) throws ParseException - Throws:
ParseException
-
keyValueOrMixedBlock
public final void keyValueOrMixedBlock(com.yahoo.tensor.TensorType type, List dimensionOrder, Map cellMap) throws ParseException - Throws:
ParseException
-
keyValue
- Throws:
ParseException
-
mixedBlock
public final void mixedBlock(com.yahoo.tensor.TensorType type, List dimensionOrder, Map cellMap) throws ParseException - Throws:
ParseException
-
indexedTensorCells
- Throws:
ParseException
-
indexedTensorCellSubspaceList
- Throws:
ParseException
-
indexedTensorCellSubspace
- Throws:
ParseException
-
tensorCell
- Throws:
ParseException
-
labelAndDimension
public final void labelAndDimension(com.yahoo.tensor.TensorAddress.Builder addressBuilder) throws ParseException - Throws:
ParseException
-
labelAndDimensionValues
- Throws:
ParseException
-
valueAddress
A tensor address (possibly on short form) represented as a list because the tensor type is not available- Throws:
ParseException
-
dimensionValue
public final com.yahoo.tensor.functions.Slice.DimensionValue dimensionValue(Optional dimensionName) throws ParseException - Throws:
ParseException
-
label
- Throws:
ParseException
-
string
- Throws:
ParseException
-
ReInit
Reinitialise- Parameters:
stream- input streamencoding- charset to be used. May not benull.
-
ReInit
Reinitialise- Parameters:
stream- char stream
-
ReInit
Reinitialise- Parameters:
tm- Token manager to use
-
getNextToken
- Returns:
- the next Token.
-
getToken
- Parameters:
index- index to be retrieved- Returns:
- the specific Token.
-
generateParseException
Generate ParseException.- Returns:
- new Exception object. Never
null
-
trace_enabled
public final boolean trace_enabled()- Returns:
- Always
false.
-
enable_tracing
public final void enable_tracing()Enable tracing. -
disable_tracing
public final void disable_tracing()Disable tracing.
-