本文整理汇总了Java中org.galagosearch.tupleflow.Parameters.get方法的典型用法代码示例。如果您正苦于以下问题:Java Parameters.get方法的具体用法?Java Parameters.get怎么用?Java Parameters.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.galagosearch.tupleflow.Parameters
的用法示例。
在下文中一共展示了Parameters.get方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFeatureClassName
import org.galagosearch.tupleflow.Parameters; //导入方法依赖的package包/类
public String getFeatureClassName(Parameters parameters) throws Exception {
if (parameters.containsKey("class")) {
return parameters.get("class");
}
String name = parameters.get("name", parameters.get("default", (String) null));
if (name == null) {
throw new Exception(
"Didn't find 'class', 'name', or 'default' parameter in this feature description.");
}
OperatorSpec operatorType = featureLookup.get(name);
if (operatorType == null) {
throw new Exception("Couldn't find a class for the feature named " + name + ".");
}
return operatorType.className;
}
示例2: handleBuild
import org.galagosearch.tupleflow.Parameters; //导入方法依赖的package包/类
private static void handleBuild(String[] args) throws Exception {
if (args.length <= 1) {
commandHelpBuild();
return;
}
// handle --links and --stemming flags
String[][] filtered = Utility.filterFlags(Utility.subarray(args, 2));
String[] flags = filtered[0];
String[] docs = filtered[1];
Parameters p = new Parameters(flags);
boolean useLinks = p.get("links", false);
boolean stemming = p.get("stemming", true);
BuildIndex build = new BuildIndex();
Job job = build.getIndexJob(args[1], docs, useLinks, stemming);
ErrorStore store = new ErrorStore();
JobExecutor.runLocally(job, store);
if (store.hasStatements()) {
System.out.println(store.toString());
}
}
示例3: DirichletScorer
import org.galagosearch.tupleflow.Parameters; //导入方法依赖的package包/类
public DirichletScorer(Parameters parameters, CountIterator iterator) throws IOException {
super(iterator);
mu = parameters.get("mu", 1500);
if (parameters.containsKey("collectionProbability")) {
background = parameters.get("collectionProbability", 0.0001);
} else {
long collectionLength = parameters.get("collectionLength", (long)0);
long count = 0;
while (!iterator.isDone()) {
count += iterator.count();
iterator.nextDocument();
}
background = (double)count / (double)collectionLength;
iterator.reset();
}
}
示例4: UnorderedWindowIterator
import org.galagosearch.tupleflow.Parameters; //导入方法依赖的package包/类
/** Creates a new instance of UnorderedWindowIterator */
public UnorderedWindowIterator(Parameters parameters, ExtentIterator[] extentIterators) throws IOException {
super(extentIterators);
this.width = (int) parameters.getAsDefault("width", -1);
this.overlap = parameters.get("overlap", false);
findDocument();
}
示例5: stemmedNode
import org.galagosearch.tupleflow.Parameters; //导入方法依赖的package包/类
private Node stemmedNode(Node original) {
Parameters parameters = original.getParameters().clone();
parameters.add("part", "stemmedPostings");
String term = parameters.get("default");
stemmer.setCurrent(term);
stemmer.stem();
String stemmed = stemmer.getCurrent();
parameters.set("default", stemmed);
return new Node("extents", parameters, original.getInternalNodes(), original.getPosition());
}
示例6: IndexWriter
import org.galagosearch.tupleflow.Parameters; //导入方法依赖的package包/类
/**
* Creates a new instance of IndexWriter
*/
public IndexWriter(String outputFilename, Parameters parameters)
throws FileNotFoundException, IOException {
// Create the parent directory:
new File(outputFilename).getParentFile().mkdirs();
blockSize = (int) parameters.get("blockSize", 32768);
isCompressed = parameters.get("isCompressed", false);
output = new DataOutputStream(new BufferedOutputStream(
new FileOutputStream(outputFilename)));
vocabulary = new VocabularyWriter();
manifest = new Parameters();
manifest.copy(parameters);
lists = new ArrayList<IndexElement>();
}
示例7: getIdentifier
import org.galagosearch.tupleflow.Parameters; //导入方法依赖的package包/类
public String getIdentifier(Parameters parameters, String fileName) {
String idType = parameters.get("identifier", "filename");
if (idType.equals("filename")) {
return fileName;
} else {
String id = stripExtensions(fileName);
id = new File(id).getName();
return id;
}
}
示例8: parseQuery
import org.galagosearch.tupleflow.Parameters; //导入方法依赖的package包/类
public static Node parseQuery(String query, Parameters parameters) {
String queryType = parameters.get("queryType", "complex");
if (queryType.equals("simple")) {
return SimpleQuery.parseTree(query);
}
return StructuredQuery.parse(query);
}
示例9: main
import org.galagosearch.tupleflow.Parameters; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
// read in parameters
Parameters parameters = new Parameters(args);
List<Parameters.Value> queries = parameters.list("query");
// open index
Retrieval retrieval = Retrieval.instance(parameters.get("index"), parameters);
// record results requested
int requested = (int) parameters.get("count", 1000);
// for each query, run it, get the results, look up the docnos, print in TREC format
for (Parameters.Value query : queries) {
// parse the query
String queryText = query.get("text");
Node queryRoot = parseQuery(queryText, parameters);
ScoredDocument[] results = retrieval.runQuery(queryRoot, requested);
for (int i = 0; i < results.length; i++) {
String document = retrieval.getDocumentName(results[i].document);
double score = results[i].score;
int rank = i + 1;
System.out.format("%s Q0 %s %d %s galago\n", query.get("number"), document, rank,
formatScore(score));
}
}
}
示例10: ScaleIterator
import org.galagosearch.tupleflow.Parameters; //导入方法依赖的package包/类
public ScaleIterator(Parameters parameters, ScoreIterator iterator) throws IllegalArgumentException {
this.iterator = iterator;
weight = parameters.get("weight", 1.0);
}
示例11: SQLDocumentStore
import org.galagosearch.tupleflow.Parameters; //导入方法依赖的package包/类
public SQLDocumentStore(Parameters parameters) throws SQLException, ClassNotFoundException {
this(parameters.get("driverName"), parameters.get("databaseUrl"));
}