uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eddie Epstein" <eaepst...@gmail.com>
Subject Re: Question: How to get diffrent Annotations at exactly the same position?
Date Sat, 26 Jan 2008 20:06:15 GMT
Hi Isaac,

If I understand your scenario, you want to ignore duplicate Person
annotations. The set index type is useful for just this purpose.

The javadocs for this index type say:
Indexing strategy: set index. A set index contains no duplicates of the same
type, where a duplicate is defined by the indexing comparator. A set index
is not guaranteed to be sorted.

A simple test shows an iterator for a set index to respect sort order, so
I'm not sure what the documentation means about "not guaranteeed to be
sorted". We'll have to wait for Thilo to clarify this.

The attached files are intended to be placed into
$UIMA_HOME/examples/descriptors/analysis_engine/SetIndexTest.xml
$UIMA_HOME/examples/src/org/apache/uima/examples/SetIndexTest.java

The test prints the following:
Set index contents:
annotation at begin=0 end=3
annotation at begin=10 end=13
annotation at begin=20 end=23

Annotation index contents:
annotation at begin=0 end=3
annotation at begin=10 end=15
annotation at begin=10 end=13
annotation at begin=20 end=23

Note that the Person at (10,15) is identical to (10,13) because the set
index is defined with only one key, the begin feature.

Regards,
Eddie

On Jan 25, 2008 7:33 AM, SAITO, Isao Isaac <130s@1995.sfc.ne.jp> wrote:

> Hi,
>
> I wonder if there is any method delivered by UIMA framework that can
> be applicable to My scenario below.
>
> My scenario:
>  - Regions annotated as Person are needed
>  - IF multiple annotations includiong Person applied to the region
> which has the same start and end position, THEN remove the Person
> annotation with that region from Index
>
>
> Though I know I can write ad-hoc codes for this,
> I like to take the best method to avoid 1)decrease performance of
> system 2)cost of writing adhoc codes in the future.
>
> Thanks,
>  Isaac
>

Mime
View raw message