You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Ar...@bka.bund.de on 2010/10/27 12:31:33 UTC

Purpose of setSofaDataURI

Hi,

what is the method setSofaDataURI(String uri, String mime) of JCas good
for? I thought that one could use it as an alternative to
setSofaDataString(). But doing so results in an empty String when
calling getDocumentText() in the analysis engine's process() method.
What am I missing?

Code snippet:
JCas jCas = analysisEngine.newJCas();
final String uri = file.toURI().toString();  // gives something like
file:/C:/some/path/to/utf8textfile.txt
jCas.setSofaDataURI(uri, "text/plain");
analysisEngine.process(jCas);  // causes NullPointerException when using
regular expressions on the empty string

Thanks,

Armin

Re: Purpose of setSofaDataURI

Posted by Eddie Epstein <ea...@gmail.com>.
Hi,

The idea is to have a Sofa external to the CAS. A short description is at
http://uima.apache.org/downloads/releaseDocs/2.3.0-incubating/docs/html/tutorials_and_users_guides/tutorials_and_users_guides.html#ugr.tug.aas.accessing_sofa_data_using_java_stream

Regards,
Eddie

On Wed, Oct 27, 2010 at 6:31 AM,  <Ar...@bka.bund.de> wrote:
>
> Hi,
>
> what is the method setSofaDataURI(String uri, String mime) of JCas good
> for? I thought that one could use it as an alternative to
> setSofaDataString(). But doing so results in an empty String when
> calling getDocumentText() in the analysis engine's process() method.
> What am I missing?
>
> Code snippet:
> JCas jCas = analysisEngine.newJCas();
> final String uri = file.toURI().toString();  // gives something like
> file:/C:/some/path/to/utf8textfile.txt
> jCas.setSofaDataURI(uri, "text/plain");
> analysisEngine.process(jCas);  // causes NullPointerException when using
> regular expressions on the empty string
>
> Thanks,
>
> Armin
>