Class EventFields

java.lang.Object
opennlp.tools.ml.model.EventFields

final class EventFields extends Object
Field delimiters and messages shared by FileEventStream, RealValueFileEventStream and SimpleEventStreamBuilder.
  • Field Details

    • MISSING_OUTCOME

      private static final String MISSING_OUTCOME
      Message for a blank line; the line is filled in.
      See Also:
    • SEPARATORS

      private static final char[] SEPARATORS
      Space, tab, carriage return, line feed and form feed.
  • Constructor Details

    • EventFields

      private EventFields()
  • Method Details

    • split

      static String[] split(String text)
      Splits on runs of space, tab, carriage return, line feed, and form feed. Other characters remain in the fields, and no empty fields are produced.
      Parameters:
      text - The event text, already checked for null by the caller.
      Returns:
      The fields in order.
    • splitLine

      static EventFields.EventLine splitLine(String line) throws InvalidFormatException
      Splits an event line into its outcome and contexts, see split(String).
      Parameters:
      line - The event line, already checked for null by the caller.
      Returns:
      The first field as outcome and the other fields as contexts.
      Throws:
      InvalidFormatException - Thrown if line is empty or contains only separators.