当前位置: 首页>>代码示例>>Java>>正文


Java NumberedDocumentData类代码示例

本文整理汇总了Java中org.galagosearch.core.types.NumberedDocumentData的典型用法代码示例。如果您正苦于以下问题:Java NumberedDocumentData类的具体用法?Java NumberedDocumentData怎么用?Java NumberedDocumentData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


NumberedDocumentData类属于org.galagosearch.core.types包,在下文中一共展示了NumberedDocumentData类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: process

import org.galagosearch.core.types.NumberedDocumentData; //导入依赖的package包/类
public void process(NumberedDocumentData numberedDocumentData) throws IOException {
    assert numberedDocumentData.number - 1 == lastDocument;
    lastDocument = numberedDocumentData.number;

    String documentName = numberedDocumentData.identifier;
    int lastDash = documentName.lastIndexOf("-");

    if (lastDash == -1) {
        putName(documentName, 0, 0);
    } else {
        String header = documentName.substring(0, lastDash);
        String footer = documentName.substring(lastDash + 1);

        try {
            int footerValue = Integer.parseInt(footer);
            putName(header, footerValue, footer.length());
        } catch (NumberFormatException e) {
            putName(documentName, 0, 0);
        }
    }

    if (documentsWritten != null) documentsWritten.increment();
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:24,代码来源:DocumentNameWriter.java

示例2: getNumberPostingsStage

import org.galagosearch.core.types.NumberedDocumentData; //导入依赖的package包/类
public Stage getNumberPostingsStage(String stageName, String inputName, String outputName) {
    Stage stage = new Stage(stageName);

    stage.add(new StageConnectionPoint(
            ConnectionPointType.Input,
            inputName, new DocumentWordPosition.DocumentWordPositionOrder()));
    stage.add(new StageConnectionPoint(
            ConnectionPointType.Input,
            "numberedDocumentData", new NumberedDocumentData.NumberOrder()));
    stage.add(new StageConnectionPoint(
            ConnectionPointType.Output,
            outputName, new NumberWordPosition.WordDocumentPositionOrder()));

    stage.add(new InputStep(inputName));
    stage.add(new Step(PositionPostingsNumberer.class));
    stage.add(Utility.getSorter(new NumberWordPosition.WordDocumentPositionOrder()));
    stage.add(new OutputStep(outputName));

    return stage;
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:21,代码来源:BuildIndex.java

示例3: getNumberExtentsStage

import org.galagosearch.core.types.NumberedDocumentData; //导入依赖的package包/类
public Stage getNumberExtentsStage() {
    Stage stage = new Stage("numberExtents");

    stage.add(new StageConnectionPoint(
            ConnectionPointType.Input,
            "extents", new DocumentExtent.IdentifierOrder()));
    stage.add(new StageConnectionPoint(
            ConnectionPointType.Input,
            "numberedDocumentData", new NumberedDocumentData.NumberOrder()));
    stage.add(new StageConnectionPoint(
            ConnectionPointType.Output,
            "numberedExtents", new NumberedExtent.ExtentNameNumberBeginOrder()));

    stage.add(new InputStep("extents"));
    stage.add(new Step(ExtentsNumberer.class));
    stage.add(Utility.getSorter(new NumberedExtent.ExtentNameNumberBeginOrder()));
    stage.add(new OutputStep("numberedExtents"));

    return stage;
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:21,代码来源:BuildIndex.java

示例4: process

import org.galagosearch.core.types.NumberedDocumentData; //导入依赖的package包/类
public void process(NumberedDocumentData object) throws IOException {
    assert document <= object.number : "d: " + document + " o.d:" + object.number;

    while (document < object.number) {
        output.writeInt(0);
        document++;
    }

    output.writeInt(object.textLength);
    document++;
    if (documentsWritten != null) documentsWritten.increment();
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:13,代码来源:DocumentLengthsWriter.java

示例5: process

import org.galagosearch.core.types.NumberedDocumentData; //导入依赖的package包/类
public void process(DocumentData data) throws IOException {
    NumberedDocumentData numbered = new NumberedDocumentData();
    numbered.identifier = data.identifier;
    numbered.url = data.url;
    numbered.textLength = data.textLength;
    numbered.number = number;
    ++number;

    processor.process(numbered);
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:11,代码来源:DocumentDataNumberer.java

示例6: PositionPostingsNumberer

import org.galagosearch.core.types.NumberedDocumentData; //导入依赖的package包/类
public PositionPostingsNumberer(TupleFlowParameters parameters) throws IOException {
    TypeReader<NumberedDocumentData> reader = parameters.getTypeReader("numberedDocumentData");
    NumberedDocumentData ndd;

    while ((ndd = reader.read()) != null) {
        documentNumbers.put(ndd.identifier, ndd.number);
    }
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:9,代码来源:PositionPostingsNumberer.java

示例7: ExtentsNumberer

import org.galagosearch.core.types.NumberedDocumentData; //导入依赖的package包/类
public ExtentsNumberer(TupleFlowParameters parameters) throws IOException {
    TypeReader<NumberedDocumentData> reader = parameters.getTypeReader("numberedDocumentData");
    NumberedDocumentData docData;

    while ((docData = reader.read()) != null) {
        documentNumbers.put(docData.identifier, docData.number);
    }
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:9,代码来源:ExtentsNumberer.java

示例8: getWriteDocumentLengthsStage

import org.galagosearch.core.types.NumberedDocumentData; //导入依赖的package包/类
/**
 * Writes document lengths to a document lengths file.
 */
public Stage getWriteDocumentLengthsStage() {
    Stage stage = new Stage("writeDocumentLengths");

    stage.add(new StageConnectionPoint(ConnectionPointType.Input,
            "numberedDocumentData", new NumberedDocumentData.NumberOrder()));
    Parameters p = new Parameters();
    p.add("filename", indexPath + File.separator + "documentLengths");
    stage.add(new InputStep("numberedDocumentData"));
    stage.add(new Step(DocumentLengthsWriter.class, p));

    return stage;
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:16,代码来源:BuildIndex.java

示例9: getWriteDocumentNamesStage

import org.galagosearch.core.types.NumberedDocumentData; //导入依赖的package包/类
/**
 * Writes document names to a document names file.
 */
public Stage getWriteDocumentNamesStage() {
    Stage stage = new Stage("writeDocumentNames");

    stage.add(new StageConnectionPoint(ConnectionPointType.Input,
            "numberedDocumentData", new NumberedDocumentData.NumberOrder()));
    Parameters p = new Parameters();
    p.add("filename", indexPath + File.separator + "documentNames");
    stage.add(new InputStep("numberedDocumentData"));
    stage.add(new Step(DocumentNameWriter.class, p));
    return stage;
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:15,代码来源:BuildIndex.java

示例10: getNumberDocumentsStage

import org.galagosearch.core.types.NumberedDocumentData; //导入依赖的package包/类
public Stage getNumberDocumentsStage() {
    Stage stage = new Stage("numberDocuments");

    stage.add(new StageConnectionPoint(ConnectionPointType.Input, "documentData",
                new DocumentData.IdentifierOrder()));
    stage.add(new StageConnectionPoint(ConnectionPointType.Output, "numberedDocumentData",
                new NumberedDocumentData.NumberOrder()));
    stage.add(new InputStep("documentData"));
    stage.add(new Step(DocumentDataNumberer.class));
    stage.add(Utility.getSorter(new NumberedDocumentData.NumberOrder()));
    stage.add(new OutputStep("numberedDocumentData"));

    return stage;
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:15,代码来源:BuildIndex.java

示例11: verify

import org.galagosearch.core.types.NumberedDocumentData; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
    Verification.verifyTypeReader("numberedDocumentData", NumberedDocumentData.class,
            parameters, handler);
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:5,代码来源:PositionPostingsNumberer.java


注:本文中的org.galagosearch.core.types.NumberedDocumentData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。