uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Eckart de Castilho <...@apache.org>
Subject Use of CASes with sofaURI?
Date Thu, 24 Oct 2019 22:11:41 GMT
Hi there,

does somebody have an example of how to work with CASes that where the sofa data is not set
using setDocumentText() but rather using setSofaDataURI(...)?         

It looks like the CAS text is then not accessible via the usual means:

	CAS cas = CasCreationUtils.createCas((TypeSystemDescription) null, null, null);
        cas.setSofaDataURI("https://www.apache.org/licenses/LICENSE-2.0.txt", "text/plain");
        CasIOUtils.save(cas, System.out, SerialFormat.XMI);
        System.out.println(cas.getDocumentText()); // -> prints "null"
        System.out.println(cas.getSofaDataString()); // -> prints "null"

Apparently, one needs to call getSofaDataStream() - but even after calling that, getDocumentAnnotation().getCoveredText()
returns null.

So how is one expected to work with CASes that are using this data URI concept?


-- Richard
View raw message