當前位置: 首頁>>代碼示例>>Java>>正文


Java Node.getOperator方法代碼示例

本文整理匯總了Java中org.galagosearch.core.retrieval.query.Node.getOperator方法的典型用法代碼示例。如果您正苦於以下問題:Java Node.getOperator方法的具體用法?Java Node.getOperator怎麽用?Java Node.getOperator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.galagosearch.core.retrieval.query.Node的用法示例。


在下文中一共展示了Node.getOperator方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: afterNode

import org.galagosearch.core.retrieval.query.Node; //導入方法依賴的package包/類
public Node afterNode(Node original) throws Exception {
    String operator = original.getOperator();

    if (operator.equals("text")) {
        if (index.containsPart("stemmedPostings")) {
            return stemmedNode(original);
        } else if (index.containsPart("postings")) {
            return transformedNode(original, "extents", "postings");
        } else {
            return original;
        }
    } else if (operator.equals("field") || operator.equals("any")) {
        if (index.containsPart("extents")) {
            return transformedNode(original, "extents", "extents");
        } else {
            return original;
        }
    } else {
        return original;
    }
}
 
開發者ID:jjfiv,項目名稱:galagosearch,代碼行數:22,代碼來源:TextFieldRewriteTraversal.java

示例2: 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());
}
 
開發者ID:jjfiv,項目名稱:galagosearch,代碼行數:27,代碼來源:ImplicitFeatureCastTraversal.java

示例3: afterNode

import org.galagosearch.core.retrieval.query.Node; //導入方法依賴的package包/類
public Node afterNode(Node node) throws Exception {
    ArrayList<Node> children = new ArrayList<Node>();

    if (node.getOperator().equals("combine")) {
        ArrayList<Node> oldChildren = node.getInternalNodes();
        for (int i = 0; i < oldChildren.size(); i++) {
            Node child = oldChildren.get(i);
            boolean isStopword = child.getOperator().equals("text") &&
                                 words.contains(child.getDefaultParameter());
            if (!isStopword) {
                children.add(child);
            }
        }

        return new Node(node.getOperator(), children);
    }
    
    return node;
}
 
開發者ID:youngilcho,項目名稱:internet-application-2014,代碼行數:20,代碼來源:RemoveStopwordsTraversal.java

示例4: getClassName

import org.galagosearch.core.retrieval.query.Node; //導入方法依賴的package包/類
public String getClassName(Node node) throws Exception {
    String operator = node.getOperator();

    if (operator.equals("feature")) {
        return getFeatureClassName(node.getParameters());
    }
    OperatorSpec operatorType = operatorLookup.get(operator);

    if (operatorType == null) {
        throw new IllegalArgumentException(
                "Unknown operator name: #" + operator);
    }
    return operatorType.className;
}
 
開發者ID:jjfiv,項目名稱:galagosearch,代碼行數:15,代碼來源:FeatureFactory.java

示例5: 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;
}
 
開發者ID:jjfiv,項目名稱:galagosearch,代碼行數:28,代碼來源:IndriWindowCompatibilityTraversal.java

示例6: getIterator

import org.galagosearch.core.retrieval.query.Node; //導入方法依賴的package包/類
public IndexIterator getIterator(Node node) throws IOException {
    if (node.getOperator().equals("scores")) {
        return getScores(node.getDefaultParameter());
    } else {
        throw new UnsupportedOperationException(
            "Index doesn't support operator: " + node.getOperator());
    }
}
 
開發者ID:jjfiv,項目名稱:galagosearch,代碼行數:9,代碼來源:SparseFloatListReader.java

示例7: getNodeType

import org.galagosearch.core.retrieval.query.Node; //導入方法依賴的package包/類
public NodeType getNodeType(Node node) throws IOException {
    NodeType result = null;
    StructuredIndexPartReader part = getIndexPart(node);
    if (part != null) {
        final String operator = node.getOperator();
        final Map<String, NodeType> nodeTypes = part.getNodeTypes();
        result = nodeTypes.get(operator);
    }
    return result;
}
 
開發者ID:jjfiv,項目名稱:galagosearch,代碼行數:11,代碼來源:StructuredIndex.java

示例8: getIterator

import org.galagosearch.core.retrieval.query.Node; //導入方法依賴的package包/類
public IndexIterator getIterator(Node node) throws IOException {
    if (node.getOperator().equals("extents")) {
        return getExtents(node.getDefaultParameter());
    } else {
        throw new UnsupportedOperationException("Node type " + node.getOperator() +
                                                " isn't supported.");
    }
}
 
開發者ID:jjfiv,項目名稱:galagosearch,代碼行數:9,代碼來源:ExtentIndexReader.java


注:本文中的org.galagosearch.core.retrieval.query.Node.getOperator方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。