Uploaded image for project: 'OpenNLP'
  1. OpenNLP
  2. OPENNLP-650

Parser command-line tool exception on input line of solely whitespace.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • tools-1.5.3
    • 1.6.0
    • Parser
    • None

    Description

      In the Parser command-line tool, if an input line is comprised of solely whitespace, then you get an array index exception in parseLine

      String text = sb.substring(0, sb.length() - 1);

      because the whitespace doesn't produce any tokens thus sb.length() is 0, and you wind up with an end position of -1.

      Simple solution is to .trim() the input string in ParserTool.

      Attachments

        Activity

          People

            joern Jörn Kottmann
            aaronbinns Aaron Binns
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: