[mercury-users] Re: java / threads / UIMA

Tomas By tomas at basun.net
Thu Aug 18 00:26:33 AEST 2011


There is no standalone-interfaces option for Java?

The top-level has to be Mercury?

/Tomas



On Wed, August 17, 2011 16:07, Tomas By wrote:
> Um...
>
> I don't think I am initializing Mercury. Perhaps that could be the
> problem?
>
> Shouldn't there be some error msg?
>
> /Tomas
>
>
>
> On Wed, August 17, 2011 16:00, Tomas By wrote:
>> Hi all,
>>
>> I have a Mercury predicate that is currently not doing anything:
>>
>> | :- pred lexlookup(string::in) is det.
>> | lexlookup(_).
>> |
>> | :- pragma foreign_export("Java",lexlookup(in),"lexlookup").
>>
>> which is called by a Java procedure:
>>
>> | public void process(JCas jcas) throws AnalysisEngineProcessException {
>> |   String text = jcas.getDocumentText();
>> |   lexlookup.lexlookup(text);
>> |   System.out.println("done");
>> | }
>>
>> overriding a `method' in a class that `extends' JCasAnnotator_ImplBase,
>> which means it is a UIMA `annotator' (see uima.apache.org).
>>
>> Here is the call:
>>
>> | class ProcessLexicon extends SwingWorker<Void,Void> {
>> |   @Override
>> |   public synchronized Void doInBackground() {
>> |     try {
>> |       Global.lex_engine.process(Global.cas);
>> |     } catch (Exception x) {
>> |       x.printStackTrace();
>> |     }
>> |     return null;
>> |   }
>> |   @Override
>> |   public void done() {
>> |   }
>> | }
>>
>> The idea being that it runs in a separate thread.
>>
>> However, it does not seem to terminate. The `done' is never printed.
>>
>> Any ideas what goes wrong? How can I debug it?
>>
>> /Tomas
>>
>>
>
>


--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list