uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tommaso Teofili <tommaso.teof...@gmail.com>
Subject Re: AnnotationFS.getCoveredText returns null?
Date Fri, 24 Feb 2012 17:15:15 GMT
2012/2/23 Jörn Kottmann <kottmann@gmail.com>

> On 02/23/2012 04:57 PM, Thilo Goetz wrote:
>> So if you ask me, the current behavior of getCoveredText() is
>> fine, it just needs to be documented.
> +1 to add documentation.
> Shouldn't we then throw an exception as well when
> the sofa is null?
> You want to get the text, that is either possible or not.
> It should be easy for user code to detect that.
> With the current implementation you have to check
> the range and for a null value.

I agree here that also explicitly handle when the sofa is null.

However I don't like to just let the IndexOutOfBoundException raise as that
may sound like a bug or unhandled situation while the API should explicitly
declare a dedicated exception for when the begin and end offset don't cover
a fully existing span of text.


> Jörn

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message