Hi Michael and everyone. I finally got it to work. The mistake that I made
was mixing the names. I am so glad though that it worked. Thanks again for
your responses and your cooperations. Best wishes,
Ahmed
On Thu, Jun 19, 2008 at 9:53 PM, Michael Tanenblatt <slothrop@park-slope.net>
wrote:
> I routinely use multiple instances of ConceptMapper, each with its own
> dictionary, in a pipeline without any issues. I think Adam is correct in his
> assessment. I have copied the section of a ConceptMapper AE descriptor that
> deals with the dictionary. Make sure that the name that appears on line 04
> matches that on line 15, and make sure that name is different from the name
> on your second ConceptMapper EA descriptor.
>
> 01 <resourceManagerConfiguration>
> 02 <externalResources>
> 03 <externalResource>
> 04 <name>DictionaryFileNameONE</name>
> 05 <description>A file containing the dictionary. Modify this URL to
> use a different dictionary.</description>
> 06 <fileResourceSpecifier>
> 07 <fileUrl>file:dict/dict_one.xml</fileUrl>
> 08 </fileResourceSpecifier>
> 09
> <implementationName>org.apache.uima.conceptMapper.support.dictionaryResource.DictionaryResource_impl</implementationName>
> 10 </externalResource>
> 11 </externalResources>
> 12 <externalResourceBindings>
> 13 <externalResourceBinding>
> 14 <key>DictionaryFile</key>
> 15 <resourceName> DictionaryFileNameONE </resourceName>
> 16 </externalResourceBinding>
> 17 </externalResourceBindings>
> 18 </resourceManagerConfiguration>
>
>
>
>
> On Jun 19, 2008, at 9:42 PM, Ahmed Abdeen Hamed wrote:
>
> I actually tried that suggestion and I had two different DictionaryFile1
>> and DictionaryFile2 for instance. Even better, I created ConceptMapper1
>> and
>> ConceptMapper2 and different type systems for each DictTerm1, DictTerm2.
>> However, it is always only one file that is used. This is why I about to
>> modify the code. My guess is, I need to store two different concepMatter
>> objects one for each dictionary in any form of a data structure such as an
>> ArrayList<ConceptMapper>. In the part where the conceptMapper object is
>> loaded I need to pass those two conceptObjects one at a time. But, I need
>> to
>> know which part of that loads the conceptMapper. Although the library is
>> only a handful of classes, still kinda tricky to follow the flow.
>> Thanks everyone!
>> Ahmed
>>
>> On Thu, Jun 19, 2008 at 9:15 PM, Adam Lally <alally@alum.rpi.edu> wrote:
>>
>> On Thu, Jun 19, 2008 at 3:12 PM, Ahmed Abdeen Hamed
>>> <ahmed.elmasri@gmail.com> wrote:
>>>
>>>> My apologies that my question wasn't clear enough. I am trying to use
>>>> the
>>>> ConceptMapper example that was posted on the list a couple of days ago.
>>>> However, the example came with one dictionary only. I have a need to
>>>>
>>> access
>>>
>>>> more than one dictionary. So, I created a primitive AE similar to the
>>>> ConceptMapperOffsetTokenizer.xml and I added its entry to the aggregate
>>>>
>>> AE
>>>
>>>> OffsetTokenizerMatcher.xml. However, the only dictionary that get loaded
>>>> when the two primitive ones are listed on the aggregate is the
>>>> dictionary
>>>> listed in the ConceptMapperOffsetTokenizer.xml, not the second
>>>> dictionary
>>>> that I just created. On the other hand, if I list only one of them in
>>>> the
>>>> aggregate AE, the correct dictionary gets loaded.
>>>>
>>>
>>> This is a guess, but make sure that in the <externalResource> element
>>> of the primitive descriptors, you use a different value of the <name>
>>> field for each of your dictionaries. And then in the
>>> <externalResourceBinding> element of each primitive descriptor, you
>>> bind that primitive AE's resourceDependency to the appropriate
>>> externalResource representing the dictionary that you want it to use.
>>>
>>> If you use the same name for more than one externalResource, only one
>>> will be used. Although I thought there was a warning in the log file
>>> in this case - you may want to check for that. For this reason, it's
>>> a good idea to use qualified names (like dotted names such as those
>>> used for Java classes) for resources.
>>>
>>> -Adam
>>>
>>>
>
|