Ejemplo n.º 1
0
 @Required
 public void setConceptVectorBuilder(IConceptVectorBuilder builder) {
   logger.info("Setting concept vector builder: " + builder.getClass().getName());
   this.builder = builder;
   if (builder instanceof IConceptIndexAware) {
     ((IConceptIndexAware) builder).setConceptIndex(this);
   }
 }
Ejemplo n.º 2
0
  @Override
  public IConceptIndex clone() throws CloneNotSupportedException {
    try {
      TerrierESAIndex newIndex = new TerrierESAIndex();
      newIndex.setTokenAnalyzer(analyzer);
      newIndex.setTerrierIndexFactory(terrierIndexFactory);
      newIndex.setLanguage(language);
      newIndex.setIndexId(indexId);
      newIndex.setWeightingModel(model);
      newIndex.setDocumentScoreModifier(dsm);

      newIndex.setConceptVectorBuilder(builder.clone());

      newIndex.readIndex();
      return newIndex;
    } catch (IOException e) {
      logger.error("Error while cloning: " + e);
    }
    return null;
  }
Ejemplo n.º 3
0
  public IConceptVector buildVector(String docName, ResultSet rs) {
    logger.info("Found " + rs.getResultSize() + " matches in index.");

    return conceptVectorBuilder.getConceptVector(
        docName, maxConceptId, rs.getDocids(), rs.getScores(), rs.getResultSize());
  }