Package com.yahoo.searchdefinition
Class MapEvaluationTypeContext
- java.lang.Object
-
- com.yahoo.searchlib.rankingexpression.rule.FunctionReferenceContext
-
- com.yahoo.searchdefinition.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 defaultjava.util.Map<com.yahoo.searchlib.rankingexpression.Reference,com.yahoo.tensor.TensorType>
featureTypes()
void
forgetResolvedTypes()
com.yahoo.tensor.TensorType
getType(com.yahoo.searchlib.rankingexpression.Reference reference)
com.yahoo.tensor.TensorType
getType(java.lang.String reference)
java.util.SortedSet<com.yahoo.searchlib.rankingexpression.Reference>
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.void
setType(com.yahoo.searchlib.rankingexpression.Reference reference, com.yahoo.tensor.TensorType type)
boolean
tensorsAreUsed()
Returns true if any feature across all instances involved in resolving this rank profile resolves to a tensorMapEvaluationTypeContext
withBindings(java.util.Map<java.lang.String,java.lang.String> bindings)
-
-
-
Method Detail
-
setType
public void setType(com.yahoo.searchlib.rankingexpression.Reference reference, com.yahoo.tensor.TensorType type)
-
getType
public com.yahoo.tensor.TensorType getType(java.lang.String reference)
- 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
-
featureTypes
public java.util.Map<com.yahoo.searchlib.rankingexpression.Reference,com.yahoo.tensor.TensorType> featureTypes()
-
queryFeaturesNotDeclared
public java.util.SortedSet<com.yahoo.searchlib.rankingexpression.Reference> 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
public MapEvaluationTypeContext withBindings(java.util.Map<java.lang.String,java.lang.String> bindings)
- Overrides:
withBindings
in classcom.yahoo.searchlib.rankingexpression.rule.FunctionReferenceContext
-
-