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

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

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

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

            • Assignee:
              joern Jörn Kottmann
              Reporter:
              ibarbulescu Ioan Barbulescu

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment