Class LMSimilarity

    • Constructor Detail

      • LMSimilarity

        public LMSimilarity​(LMSimilarity.CollectionModel collectionModel)
        Creates a new instance with the specified collection language model.
      • LMSimilarity

        public LMSimilarity()
        Creates a new instance with the default collection language model.
    • Method Detail

      • explain

        protected void explain​(Explanation expl,
                               BasicStats stats,
                               int doc,
                               float freq,
                               float docLen)
        Description copied from class: SimilarityBase
        Subclasses should implement this method to explain the score. expl already contains the score, the name of the class and the doc id, as well as the term frequency and its explanation; subclasses can add additional clauses to explain details of their scoring formulae.

        The default implementation does nothing.

        Overrides:
        explain in class SimilarityBase
        Parameters:
        expl - the explanation to extend with details.
        stats - the corpus level statistics.
        doc - the document id.
        freq - the term frequency.
        docLen - the document length.
      • getName

        public abstract String getName()
        Returns the name of the LM method. The values of the parameters should be included as well.

        Used in toString()

        .