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 <[email protected]> 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
>
>