Class SimpleHTMLFormatter

  • All Implemented Interfaces:
    Formatter

    public class SimpleHTMLFormatter
    extends java.lang.Object
    implements Formatter
    Simple Formatter implementation to highlight terms with a pre and post tag.
    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleHTMLFormatter()
      Default constructor uses HTML: <B> tags to markup terms.
      SimpleHTMLFormatter​(java.lang.String preTag, java.lang.String postTag)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String highlightTerm​(java.lang.String originalText, TokenGroup tokenGroup)  
      • Methods inherited from class java.lang.Object

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

      • SimpleHTMLFormatter

        public SimpleHTMLFormatter​(java.lang.String preTag,
                                   java.lang.String postTag)
      • SimpleHTMLFormatter

        public SimpleHTMLFormatter()
        Default constructor uses HTML: <B> tags to markup terms.
    • Method Detail

      • highlightTerm

        public java.lang.String highlightTerm​(java.lang.String originalText,
                                              TokenGroup tokenGroup)
        Specified by:
        highlightTerm in interface Formatter
        Parameters:
        originalText - The section of text being considered for markup
        tokenGroup - contains one or several overlapping Tokens along with their scores and positions.