本文整理汇总了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);
}
示例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());
}
}
示例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);
}
示例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();
}
示例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();
}
示例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);
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
示例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.");
}
}
示例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;
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例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.");
}
}