本文整理匯總了Java中org.galagosearch.core.retrieval.query.Node.getPosition方法的典型用法代碼示例。如果您正苦於以下問題:Java Node.getPosition方法的具體用法?Java Node.getPosition怎麽用?Java Node.getPosition使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.galagosearch.core.retrieval.query.Node
的用法示例。
在下文中一共展示了Node.getPosition方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: afterNode
import org.galagosearch.core.retrieval.query.Node; //導入方法依賴的package包/類
public Node afterNode(Node node) throws Exception {
ArrayList<Node> newChildren = new ArrayList<Node>();
NodeType nodeType = retrieval.getNodeType(node);
if (nodeType == null) return node;
ArrayList<Node> children = node.getInternalNodes();
// Given that we're going to pass children.size() + 1 parameters to
// this constructor, what types should those parameters have?
Class[] types = nodeType.getParameterTypes(children.size() + 1);
if (types == null) return node;
for (int i = 1; i < types.length; ++i) {
Node child = children.get(i-1);
// If the parent will expect a ScoreIterator at this position, but
// we've got a CountIterator here, we'll perform a conversion step.
if (ScoreIterator.class.isAssignableFrom(types[i]) &&
isCountNode(children.get(i-1))) {
Node feature = createSmoothingNode(child);
newChildren.add(feature);
} else {
newChildren.add(child);
}
}
return new Node(node.getOperator(), node.getParameters(),
newChildren, node.getPosition());
}
示例2: stemmedNode
import org.galagosearch.core.retrieval.query.Node; //導入方法依賴的package包/類
private Node stemmedNode(Node original) {
Parameters parameters = original.getParameters().clone();
parameters.add("part", "stemmedPostings");
String term = parameters.get("default");
stemmer.setCurrent(term);
stemmer.stem();
String stemmed = stemmer.getCurrent();
parameters.set("default", stemmed);
return new Node("extents", parameters, original.getInternalNodes(), original.getPosition());
}
示例3: afterNode
import org.galagosearch.core.retrieval.query.Node; //導入方法依賴的package包/類
public Node afterNode(Node original) {
String operator = original.getOperator();
ArrayList<Node> children = original.getInternalNodes();
if (operator.length() == 0) {
return original;
}
if (Character.isDigit(operator.codePointAt(0))) {
// this is a #n node, which is an ordered window node
return new Node("od", operator, children, original.getPosition());
} else if (operator.startsWith("od") &&
operator.length() > 2 &&
Character.isDigit(operator.codePointAt(2))) {
// this is a #od3() node
return new Node("od", operator.substring(2),
children, original.getPosition());
} else if (operator.startsWith("uw") &&
operator.length() > 2 &&
Character.isDigit(operator.codePointAt(2))) {
// this is a #uw3 node
return new Node("uw", operator.substring(2),
children, original.getPosition());
}
return original;
}
示例4: transformedNode
import org.galagosearch.core.retrieval.query.Node; //導入方法依賴的package包/類
public Node transformedNode(Node original,
String operatorName, String indexName) {
Parameters parameters = original.getParameters().clone();
parameters.add("part", indexName);
return new Node(operatorName, parameters, original.getInternalNodes(), original.getPosition());
}
示例5: createSmoothingNode
import org.galagosearch.core.retrieval.query.Node; //導入方法依賴的package包/類
Node createSmoothingNode(Node child) {
ArrayList<Node> data = new ArrayList<Node>();
data.add(child);
return new Node("feature", "dirichlet", data, child.getPosition());
}