I have separate xml engine descriptor files for set of ConceptMapper
engines, each using a distinct compiled dictionary file that is specified in
<fileUrl> as shown below.
The ConceptMapper engines are configured and run programmatically by one of
the engines in the overall UIMA pipeline, where the engines are run
selectively on data that is constructed on the fly.
Because all the descriptor files are alike (with stop word definitions,
etc.) except for the <fileUrl> that specifies the dictionary, I would like
to be able to have only one xml descriptor and be able to set a version
number as a Java -D parameter when starting the engine and then add it to
the <fileUrl> name after the ResourceSpecifier is created and before
produceAnalysisEngine is called.

Is this possible?  Or, can <fileUrl> somehow be omitted from the descriptor
file and specified at run-time as a configuration parameter?
Thanks / Dan 

ENGINE INITIALIZATION CODE:
      is = cls.getClassLoader().getResourceAsStream( desc); 
      XMLInputSource source = new XMLInputSource( is,  null); 
      ResourceSpecifier specifier =
UIMAFramework.getXMLParser().parseResourceSpecifier( source);        
      ae = UIMAFramework.produceAnalysisEngine(specifier);

DESCRIPTOR (desc):
<?xml version="1.0" encoding="UTF-8"?>
<analysisEngineDescription xmlns="http://uima.apache.org/resourceSpecifier";>
  <frameworkImplementation>org.apache.uima.java</frameworkImplementation>
  <primitive>true</primitive>
 
<annotatorImplementationName>org.apache.uima.conceptMapper.ConceptMapper</an
notatorImplementationName>
...
  <resourceManagerConfiguration>
    <externalResources>
      <externalResource>
        <name>DictionaryFileName</name>
        <description>A file containing the dictionary. Modify this URL to
use a different dictionary.</description>
        <fileResourceSpecifier>
 
<fileUrl>com/gnoetics/resources/dictionary/ConceptMapperRoots_dict</fileUrl>
         </fileResourceSpecifier>
 
<implementationName>org.apache.uima.conceptMapper.support.dictionaryResource
.CompiledDictionaryResource_impl</implementationName>
      </externalResource>
    </externalResources>
    <externalResourceBindings>
      <externalResourceBinding>
        <key>DictionaryFile</key>
        <resourceName>DictionaryFileName</resourceName>
      </externalResourceBinding>
    </externalResourceBindings>
  </resourceManagerConfiguration>
</analysisEngineDescription>

Reply via email to