Java 类org.apache.lucene.search.similarities.Lambda 实例源码

项目:elasticsearch_my    文件:IBSimilarityProvider.java   
public IBSimilarityProvider(String name, Settings settings, Settings indexSettings) {
    super(name);
    Distribution distribution = parseDistribution(settings);
    Lambda lambda = parseLambda(settings);
    Normalization normalization = parseNormalization(settings);
    this.similarity = new IBSimilarity(distribution, lambda, normalization);
}
项目:elasticsearch_my    文件:IBSimilarityProvider.java   
/**
 * Parses the given Settings and creates the appropriate {@link Lambda}
 *
 * @param settings Settings to parse
 * @return {@link Normalization} referred to in the Settings
 */
protected Lambda parseLambda(Settings settings) {
    String rawLambda = settings.get("lambda");
    Lambda lambda = LAMBDAS.get(rawLambda);
    if (lambda == null) {
        throw new IllegalArgumentException("Unsupported Lambda [" + rawLambda + "]");
    }
    return lambda;
}
项目:search    文件:IBSimilarityFactory.java   
private Lambda parseLambda(String expr) {
  if ("DF".equals(expr)) {
    return new LambdaDF();
  } else if ("TTF".equals(expr)) {
    return new LambdaTTF();
  } else {
    throw new RuntimeException("Invalid lambda: " + expr);
  }
}
项目:NYBC    文件:IBSimilarityFactory.java   
private Lambda parseLambda(String expr) {
  if ("DF".equals(expr)) {
    return new LambdaDF();
  } else if ("TTF".equals(expr)) {
    return new LambdaTTF();
  } else {
    throw new RuntimeException("Invalid lambda: " + expr);
  }
}
项目:search-core    文件:IBSimilarityFactory.java   
private Lambda parseLambda(String expr) {
  if ("DF".equals(expr)) {
    return new LambdaDF();
  } else if ("TTF".equals(expr)) {
    return new LambdaTTF();
  } else {
    throw new RuntimeException("Invalid lambda: " + expr);
  }
}
项目:read-open-source-code    文件:IBSimilarityFactory.java   
private Lambda parseLambda(String expr) {
  if ("DF".equals(expr)) {
    return new LambdaDF();
  } else if ("TTF".equals(expr)) {
    return new LambdaTTF();
  } else {
    throw new RuntimeException("Invalid lambda: " + expr);
  }
}
项目:read-open-source-code    文件:IBSimilarityFactory.java   
private Lambda parseLambda(String expr) {
  if ("DF".equals(expr)) {
    return new LambdaDF();
  } else if ("TTF".equals(expr)) {
    return new LambdaTTF();
  } else {
    throw new RuntimeException("Invalid lambda: " + expr);
  }
}