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

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

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: tools-1.5.3
    • Fix Version/s: 1.6.0
    • Component/s: Parser
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: