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

opennlp.tools.parser.Parse.remove() throws IndexOutOfBoundsException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • tools-1.5.3
    • 1.6.0
    • Parser
    • None
    • Windows 7 + java 1.7.0_21

    Description

      Parse.remove() throws IndexOutOfBoundsException if you attempt to remove the last child node of the current node (i.e. if you call remove(0) and this node has only one sub-node).
      Some background info: I was trying to remove the TK nodes from a parse.

      I attached the diff file for the change fixing the bug.
      The change is simple: a supplementary check:

      if(! parts.isEmpty())

      before rebuilding the span.

      Thank you
      Ioan

      P.S. this is my first reported bug, so please be gentle Please tell me if something is wrong with this issue, so that I fix it.

      Attachments

        1. Parse.java.diff
          0.6 kB
          Ioan Barbulescu

        Activity

          People

            joern Jörn Kottmann
            ibarbulescu Ioan Barbulescu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: