You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Eddie Epstein <ea...@gmail.com> on 2012/03/27 14:26:22 UTC

Re: fsIndexes

Covered text is actually not a feature name. It is a utility function
for types derived from uima.tcas.Annotation.

To create an index based on a string, you'd need to create a new Type
with a string feature, and create a new index for that type using that
feature as the key. Be sure to set the feature before adding the
feature structure to the index repository.

Eddie

On Mon, Mar 26, 2012 at 6:43 AM, Michael <mk...@hotmail.com> wrote:
>
> Eddie Epstein <ea...@...> writes:
>
>>
>> Have you already looked at:
>>
> http://uima.apache.org/d/uimaj-2.4.0/references.html#ugr.ref.xml.component_descriptor.aes.index
>> ?
>>
>> On Thu, Mar 22, 2012 at 1:18 PM, Michael Kooloos <mk...@...> wrote:
>> >
>> > All,
>> >
>> > I'm looking for an example on using fsIndex "index set" to define a unique
> key in my UIMA Annotator. Anyone
>> used this before and can provide me with an example? Many thanks.
>> >
>> > Michael
>> >
>>
>>
>
>
> Yes, had a look at the documentation, but can't get it to work. Can't get the
> right values for typeName and featureName. I expect the featureName to be
> 'coveredText' since that's the feature I map to my Solr field, but can't find
> the right value for the corresponding typeName.
>
> Michael
>

Re: fsIndexes

Posted by Michael <mk...@hotmail.com>.
Thanks a million!

Michael




Re: fsIndexes

Posted by Eddie Epstein <ea...@gmail.com>.
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 <mk...@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
>
>

Re: fsIndexes

Posted by Michael <mk...@hotmail.com>.
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