Class MalformedDictionaryLineException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
opennlp.spellcheck.dictionary.MalformedDictionaryLineException
All Implemented Interfaces:
Serializable

public class MalformedDictionaryLineException extends IOException
Signals that a line in a plain-text frequency dictionary did not match the expected word<TAB>count (or w1 w2<TAB>count) shape and could not be parsed.

The (1-based) line number and a truncated copy of the offending line are recorded to make the failure easy to locate in large dictionaries.

See Also:
  • Constructor Details

    • MalformedDictionaryLineException

      public MalformedDictionaryLineException(long lineNumber, String line, String reason)
      Creates a new exception.
      Parameters:
      lineNumber - the 1-based number of the offending line
      line - the raw text of the offending line
      reason - a human-readable description of what was expected
  • Method Details

    • getLineNumber

      public long getLineNumber()
      Returns:
      the 1-based number of the offending line.