org.apache.lucene.classification

Interface Classifier<T>

    • Method Detail

      • getClasses

        List<ClassificationResult<T>> getClasses(String text,
                                                 int max)
                                          throws IOException
        Get the first max classes (sorted by score, descending) assigned to the given text String.
        Parameters:
        text - a String containing text to be classified
        max - the number of return list elements
        Returns:
        the whole list of ClassificationResult, the classes and scores. Cut for "max" number of elements. Returns null if the classifier can't make lists.
        Throws:
        IOException - If there is a low-level I/O error.