Class SentimentAnalysisParser

  • All Implemented Interfaces:, Initializable, Parser

    public class SentimentAnalysisParser
    extends AbstractParser
    implements Initializable
    This parser classifies documents based on the sentiment of document. The classifier is powered by Apache OpenNLP's Maximum Entropy Classifier
    See Also:
    Serialized Form
    • Constructor Detail

      • SentimentAnalysisParser

        public SentimentAnalysisParser()
    • Method Detail

      • getSupportedTypes

        public java.util.Set<MediaType> getSupportedTypes​(ParseContext context)
        Returns the types supported
        Specified by:
        getSupportedTypes in interface Parser
        context - the parse context
        the set of types supported
      • parse

        public void parse​( stream,
                          org.xml.sax.ContentHandler handler,
                          Metadata metadata,
                          ParseContext context)
        Performs the parse
        Specified by:
        parse in interface Parser
        stream - the input
        handler - the content handler
        metadata - the metadata passed
        context - the context for the parser
        Throws: - if the document stream could not be read
        org.xml.sax.SAXException - if the SAX events could not be processed
        TikaException - if the document could not be parsed