本文整理汇总了Java中org.galagosearch.tupleflow.Parameters.containsKey方法的典型用法代码示例。如果您正苦于以下问题:Java Parameters.containsKey方法的具体用法?Java Parameters.containsKey怎么用?Java Parameters.containsKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.galagosearch.tupleflow.Parameters
的用法示例。
在下文中一共展示了Parameters.containsKey方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: store
import org.galagosearch.tupleflow.Parameters; //导入方法依赖的package包/类
public void store(Parameters p) {
if (!p.containsKey("collectionLength")) {
p.add("collectionLength", Long.toString(
getCollectionLength()));
}
if (!p.containsKey("averageDocumentLength")) {
p.add("averageDocumentLength", Double.toString(
getAverageDocumentLength()));
}
if (!p.containsKey("termCount")) {
p.add("termCount", Long.toString(getTermCount()));
}
if (!p.containsKey("documentCount")) {
p.add("documentCount",
Long.toString(getDocumentCount()));
}
if (!p.containsKey("collectionProbability")) {
p.add("collectionProbability", Double.toString(
getCollectionProbability()));
}
}
示例2: 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;
}
示例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: getSmoothing
import org.galagosearch.tupleflow.Parameters; //导入方法依赖的package包/类
public static Parameters.Value getSmoothing(Parameters parameters) {
if (parameters.containsKey("smoothing")) {
return parameters.list("smoothing").get(0);
}
return null;
}
示例5: requireParameters
import org.galagosearch.tupleflow.Parameters; //导入方法依赖的package包/类
public static boolean requireParameters(String[] required, Parameters parameters, ErrorHandler handler) {
boolean result = true;
for (String key : required) {
if (!parameters.containsKey(key)) {
handler.addError("The parameter '" + key + "' is required.");
result = false;
}
}
return result;
}