本文整理汇总了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();
}
示例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;
}
示例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;
}
示例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();
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例11: verify
import org.galagosearch.core.types.NumberedDocumentData; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
Verification.verifyTypeReader("numberedDocumentData", NumberedDocumentData.class,
parameters, handler);
}