uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eddie Epstein <eaepst...@gmail.com>
Subject Re: fsIndexes
Date Thu, 29 Mar 2012 22:11:17 GMT
You'd have to modify the source code, yes.

Creating a new index is trivial. For example, in
PersonTitleAnnotator.xml, add a new string feature to the type
example.PersonTitle. Then define a new index:
    <fsIndexCollection>
      <fsIndexes>
        <fsIndexDescription>
          <label>TestSet</label>
          <typeName>example.PersonTitle</typeName>
          <kind>set</kind>
          <keys>
            <fsIndexKey>
              <featureName>what</featureName>
              <comparator>standard</comparator>
            </fsIndexKey>
          </keys>
        </fsIndexDescription>
      </fsIndexes>
    </fsIndexCollection>

Note that types and indexes are supported by the ComponentDescriptorEditor.

In the annotator source code, define the new Feature
"mPersonTitleWhatFeature" and set it with the title type, e.g.
    	title.setStringValue(mPersonTitleWhatFeature, aTitleType);

This index will have only one instance for each unique title found in
the document.

Eddie

On Wed, Mar 28, 2012 at 8:56 AM, Michael <mkooloos@hotmail.com> wrote:
> OK, thanks Eddie.
>
>>>Be sure to set the feature before adding the
> feature structure to the index repository.
>
> Don't see how I can do this, I'm using Whitespace + Dictionary. Do I have to
> modify the source-code of these or can this all be done in de annotator.xml
> files? Anyway you can provide me with an example?
>
> Michael
>
>

Mime
View raw message