Anuj,

you can't set the document text from inside an annotator.
In an annotator, the document text is considered fixed, as
otherwise existing annotations would become invalid.

One way to programmatically set the document text is from
a UIMA application.  Here's the documentation of how you
would do that: http://tinyurl.com/aysawn

HTH,
Thilo

Anuj Kumar Gupta wrote:
> Hello Niels-
> 
> I already write code for DB connection.
> and that is working fine.
> 
> after that I am writing code like this.
> but I am getting error in 3rd Line ..
> 
> 1. String content1 = srs1.getString( "name"); //get document text
> 
> 2. JCas jcas = cas.getJCas();
> 
> 3. jcas.setDocumentText( content1);
> * Error is...
> org.apache.uima.cas.CASRuntimeException*: Data for Sofa feature
> setLocalSofaData() has already been set.
> 
> 
> Even I have not setting Document any where else in the code..
> 
> 
> 
> 
> On Mon, Jan 19, 2009 at 7:25 PM, Niels Ott <[email protected]>wrote:
> 
>> Anuj,
>>
>> Anuj Kumar Gupta schrieb:
>>
>>> Hello user-
>>>
>>> Can we use MS SQL and Oracle Database with UIMA ?
>>> Can we Extract any Information from DB and also can insert extracted data
>>> in
>>> to DB?
>>>
>> A natural place to do this in UIMA would be in a CAS Consumer. This is a
>> module that reads the annotation produced by other analysis engines. Such a
>> CAS Consumer could for example feed the then structured information into a
>> database.
>>
>> Compatibility is not a question of UIMA. Any database can be used which can
>> be accessed using the Java programming language. I'm inclined to suggest to
>> make yourself familiar with accessing databases from Java programs. However,
>> this is a topic that is rather off-topic on the UIMA mailing list.
>>
>> Best,
>>
>>   Niels
>>
>>
>> --
>> Niels Ott
>> Computational Linguist (B.A.)
>> http://www.drni.de/niels/
>>
> 

Reply via email to