Class ResultsUtility

java.lang.Object
org.opensextant.processing.ResultsUtility

public class ResultsUtility extends Object
Abstract class encapsulating basic results formatter functionality.
  • Field Details

    • TEXT_WIDTH

      public static int TEXT_WIDTH
      The default TEXT WIDTH. ~75 chars per line yields 2 lines of text.
  • Constructor Details

    • ResultsUtility

      public ResultsUtility()
  • Method Details

    • setPrePostContextFor

      public static void setPrePostContextFor(String content, TextEntity t, int doc_size)
      Given the TextEntity, set the context on that object. The text entity must have span (start, end attributes) set.
      Parameters:
      content - entire text from which entity came from
      t - the entity
      doc_size - the doc_size
    • setContextFor

      public static void setContextFor(String content, TextEntity t, int doc_size)
      Given the annotation or match, set the context on the TextEntity object. The text entity must have span (start, end attributes) set.
      Parameters:
      content - the content
      t - the t
      doc_size - the doc_size
    • isLocation

      public static boolean isLocation(TextMatch m)
      Testers for TextMatch: isLocation macro.
      Parameters:
      m - the m
      Returns:
      true, if is location
    • isDatetime

      public static boolean isDatetime(TextMatch m)
      Testers for TextMatch: isDatetime macro.
      Parameters:
      m - the m
      Returns:
      true, if is datetime
    • formatConfidence

      public static String formatConfidence(double d)
      Format confidence.
      Parameters:
      d - the d
      Returns:
      the string