Uploaded image for project: 'UIMA'
  1. UIMA
  2. UIMA-5829

`between` throws an exception for overlapping annotations

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.0.0SDK
    • 3.0.1SDK
    • UIMA
    • None

    Description

      SelectFS throws an exception in the following case. Why not return an empty list?

          Token t1 = new Token(jCas, 45, 57);
          t1.addToIndexes();
          Token t2 = new Token(jCas, 52, 52);
          t2.addToIndexes();
      
          new Sentence(jCas, 52, 52).addToIndexes();
      
          // uimaFIT: selectBetween(jCas, Sentence.class, t1, t2);
          List<Sentence> stem1 = jCas.select(Sentence.class).between(t1, t2).asList();
          assertTrue(stem1.isEmpty());
      
      java.lang.IllegalArgumentException: End value must be >= Begin value
      	at org.apache.uima.cas.impl.SelectFSs_impl.makePosAnnot(SelectFSs_impl.java:855)
      	at org.apache.uima.cas.impl.SelectFSs_impl.between(SelectFSs_impl.java:435)
      	at org.apache.uima.cas.impl.SelectFSs_impl.between(SelectFSs_impl.java:97)
      ...
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            rec Richard Eckart de Castilho
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: