Class WeightedLSHCosineVectorFactory

    • Constructor Detail

      • WeightedLSHCosineVectorFactory

        public WeightedLSHCosineVectorFactory()
    • Method Detail

      • buildVector

        public LSHVector buildVector​(int[] feature)
        Description copied from class: LSHVectorFactory
        Generate an LSHVector from a feature set, individual features are integer hashes. The integers MUST already be sorted. The same integer can occur more than once in the array (term frequency (TF) > 1). The factory decides internally how to create weights based on term frequency and any knowledge of Inverse Document Frequency (IDF)
        Specified by:
        buildVector in class LSHVectorFactory
        Parameters:
        feature - is the sorted array of integer features
        Returns:
        the newly minted LSHVector
      • restoreVectorFromXml

        public LSHVector restoreVectorFromXml​(XmlPullParser parser)
        Description copied from class: LSHVectorFactory
        Generate an LSHVector based on XML tag seen by pull parser. Factory generates weights based on term frequency info in the XML tag and its internal IDF knowledge
        Specified by:
        restoreVectorFromXml in class LSHVectorFactory
        Parameters:
        parser - is the XML parser
        Returns:
        the newly minted LSHVector
      • restoreVectorFromSql

        public LSHVector restoreVectorFromSql​(java.lang.String sql)
                                       throws java.io.IOException
        Description copied from class: LSHVectorFactory
        Generate an LSHVector based on string returned from SQL query Factory generates weights based on term frequency info in the string and its internal IDF knowledge
        Specified by:
        restoreVectorFromSql in class LSHVectorFactory
        Parameters:
        sql - is the column data string returned by an SQL query
        Returns:
        the newly minted LSHVector
        Throws:
        java.io.IOException