uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Klaus Rothenhäusler <rothe...@gmail.com>
Subject Re: Restrictions on sofa data array
Date Wed, 28 Apr 2010 07:00:37 GMT
Eddie Epstein <eaepstein@...> writes:

> On Tue, Apr 27, 2010 at 10:59 AM, Thilo Goetz <twgoetz@...> wrote:
> > My understanding is that he wants the tokens as primitives,
> > not the characters.  Annotation offsets could then be token
> > offsets, not character offsets.  That's perfectly reasonable
> > for some tasks.  We usually create annotations with the start
> > offset being the start of some token, and the end offset the
> > end of some token.  Then it's hard to find the tokens that
> > are "covered" by the annotation, which is why we have
> > subiterators, which are not super efficient.  And so on.
> > I like the idea, but I have no idea how compatible it is with
> > UIMA's idea of views and sofas.
> A StringArrayFS can be used as Sofa data.

Are you sure? The documentation explicitly denies that 

Feature Structure primitive arrays are all the UIMA Array types except
arrays of Feature Structures, Strings, and Booleans. Typically, these
are arrays of bytes, but can be other types, such as floats, longs,

And as far as I can see in the implementation for
setLocalSofaData(FeatureStructure aFS) in SofaFSImpl.java this
restriction is endorsed through following lines (77-92):
Type type = aFS.getType();
if (!type.isArray()) {
   CASRuntimeException e = new CASRuntimeException(...);
   throw e;
if (   !type.getName().equals(CAS.TYPE_NAME_BYTE_ARRAY)
    && !type.getName().equals(CAS.TYPE_NAME_DOUBLE_ARRAY)
    && !type.getName().equals(CAS.TYPE_NAME_FLOAT_ARRAY)
    && !type.getName().equals(CAS.TYPE_NAME_INTEGER_ARRAY)
    && !type.getName().equals(CAS.TYPE_NAME_LONG_ARRAY)
    && !type.getName().equals(CAS.TYPE_NAME_SHORT_ARRAY)) {
   CASRuntimeException e = new CASRuntimeException(
     new String[] { 
     "Byte/Float/Integer/Short/String/Long/Double Array",
     type.getName() });
   throw e;

Even though the exception message suggests differently.

Am I missing something?


View raw message