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


Java TupleFlowParameters类代码示例

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


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

示例1: verify

import org.galagosearch.tupleflow.TupleFlowParameters; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
    if (!parameters.getXML().containsKey("filename")) {
        handler.addError("ManifestWriter requires a 'filename' parameter.");
        return;
    }

    File f = new File(parameters.getXML().get("filename"));

    if (f.isFile() && f.canWrite()) {
        return; // good news
    }
    if (f.isDirectory()) {
        handler.addError("Pathname " + f.toString() + " exists, and it is a directory, but " +
                "ManifestWriter would like to write a file there.");
        return;
    }

    // this will search upwards and verify that we can make
    // the necessary directory structure to store this file.
    Verification.requireWriteableFile(f.toString(), handler);
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:22,代码来源:ManifestWriter.java

示例2: verifyStep

import org.galagosearch.tupleflow.TupleFlowParameters; //导入依赖的package包/类
private void verifyStep(final Attributes attributes, final TupleFlowParameters parameters) {
    String className = attributes.getValue("class");

    if (className == null) {
        addError("The step tag requires a class argument.");
        return;
    }

    if (!Verification.isClassAvailable(className)) {
        addError("Couldn't find a class named " + className);
    }

    try {
        Class c = Class.forName(className);
        Class[] parameterTypes = new Class[]{TupleFlowParameters.class, ErrorHandler.class};
        Method m = c.getDeclaredMethod("verify", parameterTypes);
        m.invoke(null, parameters, this);
    } catch (Exception e) {
        addError("Exception thrown during step verification: " + className + " " + e.getCause().
                 getMessage());
    }
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:23,代码来源:JobConstructor.java

示例3: verify

import org.galagosearch.tupleflow.TupleFlowParameters; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
    if (!parameters.getXML().containsKey("filename")) {
        handler.addError("DocumentLengthsWriter requires an 'filename' parameter.");
        return;
    }

    String filename = parameters.getXML().get("filename");
    Verification.requireWriteableFile(filename, handler);
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:10,代码来源:DocumentLengthsWriter.java

示例4: ExtentIndexWriter

import org.galagosearch.tupleflow.TupleFlowParameters; //导入依赖的package包/类
/**
 * Creates a new instance of ExtentIndexWriter
 */
public ExtentIndexWriter(TupleFlowParameters parameters) throws FileNotFoundException, IOException {
    writer = new IndexWriter(parameters);
    writer.getManifest().add("readerClass", ExtentIndexReader.class.getName());
    writer.getManifest().add("writerClass", getClass().toString());
    header = parameters.getXML();
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:10,代码来源:ExtentIndexWriter.java

示例5: ExtentValueIndexWriter

import org.galagosearch.tupleflow.TupleFlowParameters; //导入依赖的package包/类
/**
 * Creates a new instance of ExtentIndexWriter
 */
public ExtentValueIndexWriter(TupleFlowParameters parameters) throws FileNotFoundException, IOException {
    writer = new IndexWriter(parameters);
    writer.getManifest().add("readerClass", ExtentIndexReader.class.getName());
    writer.getManifest().add("writerClass", getClass().toString());
    header = parameters.getXML();
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:10,代码来源:ExtentValueIndexWriter.java

示例6: verify

import org.galagosearch.tupleflow.TupleFlowParameters; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
    if (!parameters.getXML().containsKey("filename")) {
        handler.addError("PositionsListWriter requires an 'filename' parameter.");
        return;
    }

    String index = parameters.getXML().get("filename");
    Verification.requireWriteableFile(index, handler);
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:10,代码来源:PositionIndexWriter.java

示例7: DocumentFilter

import org.galagosearch.tupleflow.TupleFlowParameters; //导入依赖的package包/类
/** Creates a new instance of DocumentFilter */
public DocumentFilter(TupleFlowParameters parameters) {
    Parameters p = parameters.getXML();
    
    for(String docno : p.stringList("identifier")) {
        docnos.add(docno);
    }
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:9,代码来源:DocumentFilter.java

示例8: FieldConflater

import org.galagosearch.tupleflow.TupleFlowParameters; //导入依赖的package包/类
public FieldConflater(TupleFlowParameters parameters) {
    List<Value> values = parameters.getXML().list("field");

    for (Value field : values) {
        List<String> sources = field.stringList("source");
        String destination = field.get("destination");

        for (String s : sources) {
            conflations.put(s, destination);
        }
    }
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:13,代码来源:FieldConflater.java

示例9: WordFilter

import org.galagosearch.tupleflow.TupleFlowParameters; //导入依赖的package包/类
public WordFilter(TupleFlowParameters params) throws IOException {
    if (params.getXML().containsKey("filename")) {
        String filename = params.getXML().get("filename");
        stopwords = Utility.readFileToStringSet(new File(filename));
    } else {
        stopwords = new HashSet(params.getXML().stringList("word"));
    }

    keepListWords = params.getXML().get("keepListWords", false);
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:11,代码来源:WordFilter.java

示例10: verify

import org.galagosearch.tupleflow.TupleFlowParameters; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
    if (parameters.getXML().containsKey("filename")) {
        return;
    }
    if (parameters.getXML().stringList("word").size() == 0) {
        handler.addWarning("Couldn't find any words in the stopword list.");
    }
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:9,代码来源:WordFilter.java

示例11: WordCounter

import org.galagosearch.tupleflow.TupleFlowParameters; //导入依赖的package包/类
public WordCounter(TupleFlowParameters parameters) throws IOException {
    maxWidth = (int) parameters.getXML().get("width", 1);
    String filename = parameters.getXML().get("filter", (String) null);
    if (filename != null) {
        filterWords = Utility.readFileToStringSet(new File(filename));
    } else {
        filterWords = null;
    }
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:10,代码来源:WordCounter.java

示例12: verify

import org.galagosearch.tupleflow.TupleFlowParameters; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
    if (!Verification.requireParameters(new String[] { "textSource" }, parameters.getXML(), handler))
        return;

    String readerName = parameters.getXML().get("textSource");
    Verification.verifyTypeReader(readerName, AdditionalDocumentText.class, parameters, handler);
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:8,代码来源:AdditionalTextCombiner.java

示例13: verify

import org.galagosearch.tupleflow.TupleFlowParameters; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
    if (!parameters.getXML().containsKey("filename")) {
        handler.addError("DocumentIndexWriter requires an 'filename' parameter.");
        return;
    }

    String index = parameters.getXML().get("filename");
    Verification.requireWriteableFile(index, handler);
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:10,代码来源:DocumentIndexWriter.java

示例14: PositionPostingsNumberer

import org.galagosearch.tupleflow.TupleFlowParameters; //导入依赖的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

示例15: verify

import org.galagosearch.tupleflow.TupleFlowParameters; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
    if (!Verification.requireParameters(new String[]{"filename"}, parameters.getXML(), handler)) {
        return;
    }
    String filename = parameters.getXML().get("filename");
    if (!new File(filename).isFile()) {
        handler.addError("File " + filename + " does not exist.");
    }
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:10,代码来源:PriorParser.java


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