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

项目:search    文件:DFRSimilarityFactory.java   
private BasicModel parseBasicModel(String expr) {
  if ("Be".equals(expr)) {
    return new BasicModelBE();
  } else if ("D".equals(expr)) {
    return new BasicModelD();
  } else if ("G".equals(expr)) {
    return new BasicModelG();
  } else if ("I(F)".equals(expr)) {
    return new BasicModelIF();
  } else if ("I(n)".equals(expr)) {
    return new BasicModelIn();
  } else if ("I(ne)".equals(expr)) {
    return new BasicModelIne();
  } else if ("P".equals(expr)) {
    return new BasicModelP();
  } else {
    throw new RuntimeException("Invalid basicModel: " + expr);
  }
}
项目:NYBC    文件:DFRSimilarityFactory.java   
private BasicModel parseBasicModel(String expr) {
  if ("Be".equals(expr)) {
    return new BasicModelBE();
  } else if ("D".equals(expr)) {
    return new BasicModelD();
  } else if ("G".equals(expr)) {
    return new BasicModelG();
  } else if ("I(F)".equals(expr)) {
    return new BasicModelIF();
  } else if ("I(n)".equals(expr)) {
    return new BasicModelIn();
  } else if ("I(ne)".equals(expr)) {
    return new BasicModelIne();
  } else if ("P".equals(expr)) {
    return new BasicModelP();
  } else {
    throw new RuntimeException("Invalid basicModel: " + expr);
  }
}
项目:search-core    文件:DFRSimilarityFactory.java   
private BasicModel parseBasicModel(String expr) {
  if ("Be".equals(expr)) {
    return new BasicModelBE();
  } else if ("D".equals(expr)) {
    return new BasicModelD();
  } else if ("G".equals(expr)) {
    return new BasicModelG();
  } else if ("I(F)".equals(expr)) {
    return new BasicModelIF();
  } else if ("I(n)".equals(expr)) {
    return new BasicModelIn();
  } else if ("I(ne)".equals(expr)) {
    return new BasicModelIne();
  } else if ("P".equals(expr)) {
    return new BasicModelP();
  } else {
    throw new RuntimeException("Invalid basicModel: " + expr);
  }
}
项目:read-open-source-code    文件:DFRSimilarityFactory.java   
private BasicModel parseBasicModel(String expr) {
  if ("Be".equals(expr)) {
    return new BasicModelBE();
  } else if ("D".equals(expr)) {
    return new BasicModelD();
  } else if ("G".equals(expr)) {
    return new BasicModelG();
  } else if ("I(F)".equals(expr)) {
    return new BasicModelIF();
  } else if ("I(n)".equals(expr)) {
    return new BasicModelIn();
  } else if ("I(ne)".equals(expr)) {
    return new BasicModelIne();
  } else if ("P".equals(expr)) {
    return new BasicModelP();
  } else {
    throw new RuntimeException("Invalid basicModel: " + expr);
  }
}
项目:read-open-source-code    文件:DFRSimilarityFactory.java   
private BasicModel parseBasicModel(String expr) {
  if ("Be".equals(expr)) {
    return new BasicModelBE();
  } else if ("D".equals(expr)) {
    return new BasicModelD();
  } else if ("G".equals(expr)) {
    return new BasicModelG();
  } else if ("I(F)".equals(expr)) {
    return new BasicModelIF();
  } else if ("I(n)".equals(expr)) {
    return new BasicModelIn();
  } else if ("I(ne)".equals(expr)) {
    return new BasicModelIne();
  } else if ("P".equals(expr)) {
    return new BasicModelP();
  } else {
    throw new RuntimeException("Invalid basicModel: " + expr);
  }
}
项目:elasticsearch_my    文件:DFRSimilarityProvider.java   
public DFRSimilarityProvider(String name, Settings settings, Settings indexSettings) {
    super(name);
    BasicModel basicModel = parseBasicModel(settings);
    AfterEffect afterEffect = parseAfterEffect(settings);
    Normalization normalization = parseNormalization(settings);
    this.similarity = new DFRSimilarity(basicModel, afterEffect, normalization);
}
项目:elasticsearch_my    文件:DFRSimilarityProvider.java   
/**
 * Parses the given Settings and creates the appropriate {@link BasicModel}
 *
 * @param settings Settings to parse
 * @return {@link BasicModel} referred to in the Settings
 */
protected BasicModel parseBasicModel(Settings settings) {
    String basicModel = settings.get("basic_model");
    BasicModel model = BASIC_MODELS.get(basicModel);
    if (model == null) {
        throw new IllegalArgumentException("Unsupported BasicModel [" + basicModel + "]");
    }
    return model;
}