Hi,

negated match conditions are not supported in UIMA Ruta and there are no plans yet to support them in near future for different reasons. If supported in your example, the negation would match on all possible combinations of all possible annotations within the sentence that do not fulfill the sequential pattern. The problem with true negatives in information extraction...

You need to move the negation to the condition part. The easiest way to solve your problem is to use two rules. You could do something like:
(not tested right now)

DECLARE ChunkPattern;
Chunk.chunk=="NP"+ Chunk.chunk=="VP"+ Chunk.chunk == "ADJP"{-> MARK(ChunkPattern, 1,3)}; Sentence{-CONTAINS(ChunkPattern) -> CREATE(Error, "name"= "SVO", "kind" = "Simple/Direct")};

DECLARE ChunkSent;
Sentence{-> ChunkSent} <-{Chunk.chunk=="NP"+ Chunk.chunk=="VP"+ Chunk.chunk == "ADJP";}; Sentence{-PARTOF(ChunkSent) -> CREATE(Error, "name"= "SVO", "kind" = "Simple/Direct")};

The helper annotation types can also contain a generic feature for storing the string values of the created error annotation.

btw, writing the complete long name for referring to a type can be very annoying. You maybe want to take a look at IMPORT FROM AS for aliasing or at the type variables.

Let me know if this makes sense for you.

Best,

Peter


Am 07.10.2015 um 00:25 schrieb Juan Ignacio Velez:
Hi, i'm developing grammar rules with UIMA Ruta and i have a question. I
can't write a NOT clause with "-" character. The rule is this:

edu.isistan.uima.unified.typesystems.nlp.Sentence{ -> CREATE(Error, "name"
= "SVO", "kind" = "Simple/Direct")} <- {
- (
     (edu.isistan.uima.unified.typesystems.nlp.Chunk.chunk == "NP")+
     (edu.isistan.uima.unified.typesystems.nlp.Chunk.chunk == "VP")+
     (edu.isistan.uima.unified.typesystems.nlp.Chunk.chunk == "ADJP")
);
};

I appreciate your help.

Thanks a lot!

Juan Ignacio


  • Question Juan Ignacio Velez
    • Re: Question Peter Klügl

Reply via email to