ctakes-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Siamak Barzegar <barzegar.sia...@gmail.com>
Subject Accessing the External Resource from the UimaContext without Using XML descriptor
Date Tue, 25 Jun 2019 13:23:32 GMT
I would like to use different cTAKES' components by using PipelineBuilder
(exactly the same in HelloWorldBuilderRunner.java).
But the problem is (As I understand it), PipelineBuilder does not read XML
descriptor of the component. I want to use the Dictionary Lookup component
(DictionaryLookupannotatorCSV.xml) in the following components:

         PipelineBuilder builder = new PipelineBuilder();
         builder
              .add( SimpleSegmentAnnotator.class )
              .add( SentenceDetector.class )
              .add( TokenizerAnnotator.class )
               // Java Class file of DictionaryLookupannotatorCSV.xml is:
              .add(DictionaryLookupAnnotator.class);

But in the DictionaryLookupannotatorCSV.xml file, there are several
external resources that DictionaryLookupAnnotator needs to read them:

public void initialize(UimaContext aContext) {
  iv_context = aContext;
   ....
  FileResource fResrc = (FileResource)
iv_context.getResourceObject("LookupDescriptor");
    ...
   iv_lookupSpecSet = LookupParseUtilities.parseDescriptor(descFile,
iv_context);
}

So, what is the best way for having access to these
resources(LookupDescriptorFile, DictionaryFileResource, RxnormIndex and
OrangeBookIndex) in DictionaryLookupannotatorCSV.xml from the code?

Thanks a lot.
Siamak

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message