Class DocToDoubleVectorUtils


  • public class DocToDoubleVectorUtils
    extends java.lang.Object
    utility class for converting Lucene Documents to Double vectors.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Double[] toDenseLocalFreqDoubleArray​(Terms docTerms)
      create a dense Double vector given doc and field term vectors using local frequency of the terms in the doc
      static java.lang.Double[] toSparseLocalFreqDoubleArray​(Terms docTerms, Terms fieldTerms)
      create a sparse Double vector given doc and field term vectors using local frequency of the terms in the doc
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DocToDoubleVectorUtils

        private DocToDoubleVectorUtils()
    • Method Detail

      • toSparseLocalFreqDoubleArray

        public static java.lang.Double[] toSparseLocalFreqDoubleArray​(Terms docTerms,
                                                                      Terms fieldTerms)
                                                               throws java.io.IOException
        create a sparse Double vector given doc and field term vectors using local frequency of the terms in the doc
        Parameters:
        docTerms - term vectors for a given document
        fieldTerms - field term vectors
        Returns:
        a sparse vector of Doubles as an array
        Throws:
        java.io.IOException - in case accessing the underlying index fails
      • toDenseLocalFreqDoubleArray

        public static java.lang.Double[] toDenseLocalFreqDoubleArray​(Terms docTerms)
                                                              throws java.io.IOException
        create a dense Double vector given doc and field term vectors using local frequency of the terms in the doc
        Parameters:
        docTerms - term vectors for a given document
        Returns:
        a dense vector of Doubles as an array
        Throws:
        java.io.IOException - in case accessing the underlying index fails