Package com.yahoo.schema
Class MapEvaluationTypeContext
java.lang.Object
com.yahoo.searchlib.rankingexpression.rule.FunctionReferenceContext
com.yahoo.schema.MapEvaluationTypeContext
- All Implemented Interfaces:
com.yahoo.tensor.evaluation.TypeContext<com.yahoo.searchlib.rankingexpression.Reference>
public class MapEvaluationTypeContext
extends com.yahoo.searchlib.rankingexpression.rule.FunctionReferenceContext
implements com.yahoo.tensor.evaluation.TypeContext<com.yahoo.searchlib.rankingexpression.Reference>
A context which only contains type information.
This returns empty tensor types (double) for unknown features which are not
query, attribute or constant features, as we do not have information about which such
features exist (but we know those that exist are doubles).
This is not multithread safe.
- Author:
- bratseth
-
Method Summary
Modifier and TypeMethodDescriptioncom.yahoo.tensor.TensorType
defaultTypeOf
(com.yahoo.searchlib.rankingexpression.Reference reference) Returns the default type for this simple feature, or null if it does not have a defaultMap<com.yahoo.searchlib.rankingexpression.Reference,
com.yahoo.tensor.TensorType> void
com.yahoo.tensor.TensorType
getType
(com.yahoo.searchlib.rankingexpression.Reference reference) com.yahoo.tensor.TensorType
SortedSet<com.yahoo.searchlib.rankingexpression.Reference>
Returns an unmodifiable view of the query features which was requested but for which we have no type info (such that they default to TensorType.empty), shared between all instances of this involved in resolving a particular rank profile.void
setType
(com.yahoo.searchlib.rankingexpression.Reference reference, com.yahoo.tensor.TensorType type) boolean
Returns true if any feature across all instances involved in resolving this rank profile resolves to a tensorwithBindings
(Map<String, String> bindings) Methods inherited from class com.yahoo.searchlib.rankingexpression.rule.FunctionReferenceContext
getBinding, getFunction, getFunctions, withoutBindings
-
Method Details
-
setType
public void setType(com.yahoo.searchlib.rankingexpression.Reference reference, com.yahoo.tensor.TensorType type) -
featureTypes
public Map<com.yahoo.searchlib.rankingexpression.Reference,com.yahoo.tensor.TensorType> featureTypes() -
getType
- Specified by:
getType
in interfacecom.yahoo.tensor.evaluation.TypeContext<com.yahoo.searchlib.rankingexpression.Reference>
-
forgetResolvedTypes
public void forgetResolvedTypes() -
getType
public com.yahoo.tensor.TensorType getType(com.yahoo.searchlib.rankingexpression.Reference reference) - Specified by:
getType
in interfacecom.yahoo.tensor.evaluation.TypeContext<com.yahoo.searchlib.rankingexpression.Reference>
-
defaultTypeOf
public com.yahoo.tensor.TensorType defaultTypeOf(com.yahoo.searchlib.rankingexpression.Reference reference) Returns the default type for this simple feature, or null if it does not have a default -
queryFeaturesNotDeclared
Returns an unmodifiable view of the query features which was requested but for which we have no type info (such that they default to TensorType.empty), shared between all instances of this involved in resolving a particular rank profile. -
tensorsAreUsed
public boolean tensorsAreUsed()Returns true if any feature across all instances involved in resolving this rank profile resolves to a tensor -
withBindings
- Overrides:
withBindings
in classcom.yahoo.searchlib.rankingexpression.rule.FunctionReferenceContext
-