uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thilo Goetz <twgo...@gmx.de>
Subject Re: AnnotationFS.getCoveredText returns null?
Date Thu, 23 Feb 2012 14:05:23 GMT
On 23/02/12 13:33, Jörn Kottmann wrote:
> Hi all,
> 
> the CasEditor code assumes that getCoveredText never returns
> null.
> 
> Should that always be the case?
> 
> I have here a CAS with two DocumentAnnotations:
> 
> 1. The one created by UIMA
> 2. An ArticleDocumentAnnotation (extends DocumentAnnotation)
>     where the begin and end indexes are 0
> 
> The second one returns null when getCoveredText is called
> (I can do more debugging when needed).
> 
> Jörn

This is the source code:

  public String getCoveredText() {
    final CAS casView = this.getView();
    final String text = casView.getDocumentText();
    if (text == null) {
      return null;
    }
    return text.substring(getBegin(), getEnd());
  }

Your ArticleDocumentAnnotation probably belongs to a different
view or sofa or whatever the right terminology is, which doesn't
have a document text.

--Thilo

Mime
View raw message