Package edu.isi.karma.semantictypes.tfIdf

Examples of edu.isi.karma.semantictypes.tfIdf.Indexer


        // Ignore, the searcher might not work if index is empty.
      }
    }

    // index the document
    Indexer indexer = new Indexer(indexDirectory);
    try {
      indexer.open();
      if (labelDoc != null) {
        IndexableField existingContent = labelDoc.getField(Indexer.CONTENT_FIELD_NAME);
        indexer.updateDocument(existingContent, sb.toString(), label);
      } else {
        indexer.addDocument(sb.toString(), label);
      }
      indexer.commit();
    } finally {
      indexer.close();
    }

    return true;
  }
View Full Code Here


   */
  @Override
  public boolean removeAllLabels() {

    try {
      Indexer indexer = new Indexer(indexDirectory);
      try {
        indexer.open();
        indexer.deleteAllDocuments();
        indexer.commit();
      } finally {
        indexer.close();
      }
    } catch (IOException e) {
      e.printStackTrace();
    }

View Full Code Here

TOP

Related Classes of edu.isi.karma.semantictypes.tfIdf.Indexer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.