Thanks Peter! I have read the documentation, but forgot about that condition.
________________________________________
From: Peter Klügl [pklu...@uni-wuerzburg.de]
Sent: Wednesday, May 01, 2013 6:18 AM
To: user@uima.apache.org
Subject: Re: Textmarker: delete contained annotations

Hi,

Am 01.05.2013 04:57, schrieb William Karl Thompson:
> Hi,
>
> I'm working with the cTAKES pipeline to annotate some clinical text. The 
> cTAKES syntactic chunker generates overlapping and nested annotations with 
> the same syntactic type. For example:
>
> [NP ascending [NP colon polyps]]
>
> What I would like to do is to use TextMarker rules to eliminate nested 
> annotations, so at the end of the day just have the following:
>
> [NP colon ascending polyps]
>
> I've tried to use UNMARK, but the following two rules appear to remove all 
> NPs starting at the first match, even the containing annotation:
>
> NP{PARTOF(NP)->UNMARK(NP)};
> NP{CONTAINS(NP)->UNMARK(NP)};
>
> Is there way to accomplish this that I'm missing? Using loops perhaps?

The simplest solution in your situation would be:

NP{PARTOFNEQ(NP) -> UNMARK(NP)};

(PARTOFNEQ: part of, but not equal)

If it gets more complicated, then something with a loop and/or
additional types is necessary:

BLOCK(forEach) Test{} {
     ANY+? Test{-> UNMARK(Test)};
     Test{-> UNMARK(Test)} ANY;
}


Best,

Peter

> Thanks,
>
> Will
>

Reply via email to