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 2011/11/11 07:59:36 UTC
Common interface for sofa data and sofa reference
Hi,
A text sofa can be included in a CAS or it can be referenced by an URI.
Writing an annotator, I do not want to distinguish between these two
ways. I would like to have a common interface for both. Does it exist?
Or do I have to write two versions of each annotator? For example, I'd
like to have one method to get the document text, regardless whether it
is included or referenced.
Greetings,
Armin
AW: Common interface for sofa data and sofa reference
Posted by Ar...@bka.bund.de.
Hi Richard,
it works. I used
String documentText = FileUtils.reader2String(new InputStreamReader(cas.getSofaDataStream)));
Thanks
Armin
-----Ursprüngliche Nachricht-----
Von: Richard Eckart de Castilho [mailto:eckartde@tk.informatik.tu-darmstadt.de]
Gesendet: Sonntag, 13. November 2011 16:38
An: user@uima.apache.org
Betreff: Re: Common interface for sofa data and sofa reference
Hi Armin,
I didn't try it, but I believe CAS.getSofaDataStream() should work for you. But I believe the getCoveredText() method will only work for text that is included with the CAS.
-- Richard
Am 11.11.2011 um 07:59 schrieb Armin.Wegner@bka.bund.de:
>
> Hi,
>
> A text sofa can be included in a CAS or it can be referenced by an URI.
> Writing an annotator, I do not want to distinguish between these two
> ways. I would like to have a common interface for both. Does it exist?
> Or do I have to write two versions of each annotator? For example, I'd
> like to have one method to get the document text, regardless whether
> it is included or referenced.
>
> Greetings,
>
> Armin
--
-------------------------------------------------------------------
Richard Eckart de Castilho
Technical Lead
Ubiquitous Knowledge Processing Lab
FB 20 Computer Science Department
Technische Universität Darmstadt
Hochschulstr. 10, D-64289 Darmstadt, Germany phone [+49] (0)6151 16-7477, fax -5455, room S2/02/B117 eckartde@tk.informatik.tu-darmstadt.de
www.ukp.tu-darmstadt.de
Web Research at TU Darmstadt (WeRC) www.werc.tu-darmstadt.de
-------------------------------------------------------------------
Re: Common interface for sofa data and sofa reference
Posted by Richard Eckart de Castilho <ec...@tk.informatik.tu-darmstadt.de>.
Hi Armin,
I didn't try it, but I believe CAS.getSofaDataStream() should work for you. But I believe the getCoveredText() method will only work for text that is included with the CAS.
-- Richard
Am 11.11.2011 um 07:59 schrieb Armin.Wegner@bka.bund.de:
>
> Hi,
>
> A text sofa can be included in a CAS or it can be referenced by an URI.
> Writing an annotator, I do not want to distinguish between these two
> ways. I would like to have a common interface for both. Does it exist?
> Or do I have to write two versions of each annotator? For example, I'd
> like to have one method to get the document text, regardless whether it
> is included or referenced.
>
> Greetings,
>
> Armin
--
-------------------------------------------------------------------
Richard Eckart de Castilho
Technical Lead
Ubiquitous Knowledge Processing Lab
FB 20 Computer Science Department
Technische Universität Darmstadt
Hochschulstr. 10, D-64289 Darmstadt, Germany
phone [+49] (0)6151 16-7477, fax -5455, room S2/02/B117
eckartde@tk.informatik.tu-darmstadt.de
www.ukp.tu-darmstadt.de
Web Research at TU Darmstadt (WeRC) www.werc.tu-darmstadt.de
-------------------------------------------------------------------