diff options
author | Jon Bratseth <bratseth@oath.com> | 2018-02-24 18:32:38 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@oath.com> | 2018-02-24 18:32:38 +0100 |
commit | 6cb1c29a8076f22415ef448bd114dfec9b37e00e (patch) | |
tree | 6c6377915ab00cb06eac66d46ae3470edfc6f10a /searchlib/src/main | |
parent | 180bc0034ae5ba6f2b5644a7c520486bbcc511bd (diff) |
Cleanup and more type inference
- Use a type context in TensorTransformer
- Correct Join.outputType
- Understand tensorFromLabels and tensorFromWeightedSet
- Don't wrap simple tensor arguments in constant()
Diffstat (limited to 'searchlib/src/main')
-rwxr-xr-x | searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/rule/ReferenceNode.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/rule/ReferenceNode.java b/searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/rule/ReferenceNode.java index 78f53b1593d..822d6055815 100755 --- a/searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/rule/ReferenceNode.java +++ b/searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/rule/ReferenceNode.java @@ -16,7 +16,6 @@ import java.util.List; /** * A node referring either to a value in the context or to a named ranking expression (function aka macro). * - * @author simon * @author bratseth */ public final class ReferenceNode extends CompositeNode { @@ -64,11 +63,13 @@ public final class ReferenceNode extends CompositeNode { @Override public String toString(SerializationContext context, Deque<String> path, CompositeNode parent) { + // A reference to a macro argument? if (reference.isIdentifier() && context.getBinding(getName()) != null) { // a bound identifier: replace by the value it is bound to return context.getBinding(getName()); } + // A reference to a function? ExpressionFunction function = context.getFunction(getName()); if (function != null && function.arguments().size() == getArguments().size() && getOutput() == null) { // a function reference: replace by the referenced function wrapped in rankingExpression @@ -84,7 +85,7 @@ public final class ReferenceNode extends CompositeNode { return "rankingExpression(" + instance.getName() + ")"; } - // not resolved in this context: output as-is + // Not resolved in this context: output as-is return reference.toString(context, path, parent); } |