Revision: 15225
          http://gate.svn.sourceforge.net/gate/?rev=15225&view=rev
Author:   valyt
Date:     2012-01-26 12:18:52 +0000 (Thu, 26 Jan 2012)
Log Message:
-----------
Accepting patch for notWithin JAPE predicate.

Added Paths:
-----------
    gate/trunk/src/gate/jape/constraint/NotWithinPredicate.java

Added: gate/trunk/src/gate/jape/constraint/NotWithinPredicate.java
===================================================================
--- gate/trunk/src/gate/jape/constraint/NotWithinPredicate.java                 
        (rev 0)
+++ gate/trunk/src/gate/jape/constraint/NotWithinPredicate.java 2012-01-26 
12:18:52 UTC (rev 15225)
@@ -0,0 +1,51 @@
+/*
+ *  NotWithinPredicate.java
+ *
+ *  Copyright (c) 1995-2010, The University of Sheffield. See the file
+ *  COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
+ *
+ *  This file is part of GATE (see http://gate.ac.uk/), and is free
+ *  software, licenced under the GNU Library General Public License,
+ *  Version 2, June 1991 (in the distribution as file licence.html,
+ *  and also available at http://gate.ac.uk/gate/licence.html).
+ *
+ *  Julien Nioche, 26 Jan 2012
+ *
+ *  $Id$
+ */
+package gate.jape.constraint;
+
+import gate.Annotation;
+import gate.AnnotationSet;
+import gate.jape.JapeException;
+
+import java.util.Collection;
+
+/**
+ * Returns false if the given annotation is entirely spanned by an annotation
+ * of the type set in value.
+ */
+public class NotWithinPredicate extends WithinPredicate {
+
+    public static final String OPERATOR = "notWithin";
+
+    public String getOperator() {
+        return OPERATOR;
+    }
+
+    /**
+     * Sets up environment for concreate class to do the specific matching 
check
+     */
+    public boolean doMatch(Object annotValue, AnnotationSet context)
+            throws JapeException {
+
+      Annotation annot = (Annotation)annotValue;
+      AnnotationSet containedSet = doMatch(annot, context);
+
+      Collection<Annotation> filteredSet = filterMatches(containedSet);
+
+      // this is where it differs from WithinPredicate
+      return filteredSet.isEmpty();
+    }
+
+}
\ No newline at end of file


Property changes on: gate/trunk/src/gate/jape/constraint/NotWithinPredicate.java
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to