Package com.yahoo.searchlib.treenet.rule
Class ComparisonCondition
java.lang.Object
com.yahoo.searchlib.treenet.rule.TreeNode
com.yahoo.searchlib.treenet.rule.Condition
com.yahoo.searchlib.treenet.rule.ComparisonCondition
Represents a condition which comparing two values
- Author:
- Simon Thoresen Hult
-
Constructor Summary
ConstructorDescriptionComparisonCondition
(String lhs, double rhs, String ift, String iff) Constructs a new instance of this class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the ranking expression string for the condition part of this condition, i.e the ...double
Returns the constant to compare the feature with.Methods inherited from class com.yahoo.searchlib.treenet.rule.Condition
getFalseLabel, getLeftValue, getTrueLabel, toRankingExpression
-
Constructor Details
-
ComparisonCondition
Constructs a new instance of this class.- Parameters:
lhs
- The name of the feature to compare to a constant.rhs
- The constant to compare the feature with.ift
- The label to jump to if left < right.iff
- The label to jump to if left >= right;
-
-
Method Details
-
getConstant
public double getConstant()Returns the constant to compare the feature with.- Returns:
- The constant.
-
conditionToRankingExpression
Description copied from class:Condition
Returns the ranking expression string for the condition part of this condition, i.e the ... part ofif(leftValue ..., trueExpression, falseExpression)
- Specified by:
conditionToRankingExpression
in classCondition
-