You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by pk...@apache.org on 2012/01/09 13:08:46 UTC

svn commit: r1229104 - in /uima/sandbox/trunk/TextMarker: uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/testing/evaluator/ uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/ uimaj-ep-textmarker-engine/src/main/ja...

Author: pkluegl
Date: Mon Jan  9 12:08:45 2012
New Revision: 1229104

URL: http://svn.apache.org/viewvc?rev=1229104&view=rev
Log:
UIMA-2319
added constants for primitive types
added keywords for float

Added:
    uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/UIMAConstants.java
Modified:
    uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/testing/evaluator/FeatureCasEvaluator.java
    uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/testing/evaluator/StringFeatureCasEvaluator.java
    uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/AbstractStructureAction.java
    uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/GetFeatureAction.java
    uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/MarkTableAction.java
    uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/SetFeatureAction.java
    uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/condition/FeatureCondition.java
    uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/core/TextMarkerKeywords.java
    uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/core/builder/TextMarkerSimpleBuilder.java
    uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/parser/ast/TMTypeConstants.java
    uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/validator/TextMarkerTypeChecker.java

Modified: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/testing/evaluator/FeatureCasEvaluator.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/testing/evaluator/FeatureCasEvaluator.java?rev=1229104&r1=1229103&r2=1229104&view=diff
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/testing/evaluator/FeatureCasEvaluator.java (original)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/testing/evaluator/FeatureCasEvaluator.java Mon Jan  9 12:08:45 2012
@@ -34,6 +34,7 @@ import org.apache.uima.cas.Type;
 import org.apache.uima.cas.TypeSystem;
 import org.apache.uima.cas.text.AnnotationFS;
 import org.apache.uima.jcas.tcas.Annotation;
+import org.apache.uima.textmarker.UIMAConstants;
 import org.apache.uima.textmarker.engine.TextMarkerEngine;
 
 public class FeatureCasEvaluator implements ICasEvaluator {
@@ -47,7 +48,7 @@ public class FeatureCasEvaluator impleme
     Type truePositiveType = run.getTypeSystem().getType(ICasEvaluator.TRUE_POSITIVE);
     Feature feature = falsePositiveType.getFeatureByBaseName(ICasEvaluator.ORIGINAL);
     Type annotationType = test.getAnnotationType();
-    Type stringType = run.getTypeSystem().getType("uima.cas.String");
+    Type stringType = run.getTypeSystem().getType(UIMAConstants.TYPE_STRING);
     Type basicType = run.getTypeSystem().getType(TextMarkerEngine.BASIC_TYPE);
     List<Type> allTypes = test.getTypeSystem().getProperlySubsumedTypes(annotationType);
     List<Type> types = new ArrayList<Type>();
@@ -208,7 +209,7 @@ public class FeatureCasEvaluator impleme
           }
         }
 
-        if ("uima.cas.String".equals(range.getName())) {
+        if (UIMAConstants.TYPE_STRING.equals(range.getName())) {
           String valueTest = fs.getFeatureValueAsString(feature);
           if (valueTest != null) {
             Feature feature2 = newFS.getType().getFeatureByBaseName(feature.getShortName());
@@ -245,7 +246,7 @@ public class FeatureCasEvaluator impleme
           for (Feature feature : features) {
             Type range = feature.getRange();
             if (typeSystem.subsumes(annotationType, range)
-                    || "uima.cas.String".equals(range.getName())) {
+                    || UIMAConstants.TYPE_STRING.equals(range.getName())) {
               result.add(fs);
               break;
             }
@@ -322,7 +323,7 @@ public class FeatureCasEvaluator impleme
 
       }
 
-      if ("uima.cas.String".equals(range.getName())) {
+      if (UIMAConstants.TYPE_STRING.equals(range.getName())) {
 
         String name = eachFeature1.getShortName();
 

Modified: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/testing/evaluator/StringFeatureCasEvaluator.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/testing/evaluator/StringFeatureCasEvaluator.java?rev=1229104&r1=1229103&r2=1229104&view=diff
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/testing/evaluator/StringFeatureCasEvaluator.java (original)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/testing/evaluator/StringFeatureCasEvaluator.java Mon Jan  9 12:08:45 2012
@@ -34,6 +34,7 @@ import org.apache.uima.cas.Type;
 import org.apache.uima.cas.TypeSystem;
 import org.apache.uima.cas.text.AnnotationFS;
 import org.apache.uima.jcas.tcas.Annotation;
+import org.apache.uima.textmarker.UIMAConstants;
 import org.apache.uima.textmarker.engine.TextMarkerEngine;
 
 public class StringFeatureCasEvaluator implements ICasEvaluator {
@@ -47,7 +48,7 @@ public class StringFeatureCasEvaluator i
     List<Type> allTypes = test.getTypeSystem().getProperlySubsumedTypes(
             test.getTypeSystem().getTopType());
     List<Type> types = new ArrayList<Type>();
-    Type stringType = run.getTypeSystem().getType("uima.cas.String");
+    Type stringType = run.getTypeSystem().getType(UIMAConstants.TYPE_STRING);
     Type basicType = run.getTypeSystem().getType(TextMarkerEngine.BASIC_TYPE);
 
     TypeSystem typeSystem = test.getTypeSystem();
@@ -140,7 +141,7 @@ public class StringFeatureCasEvaluator i
       CAS runCas = newFS.getCAS();
       TypeSystem testTS = testCas.getTypeSystem();
       TypeSystem runTS = runCas.getTypeSystem();
-      Type stringType = testTS.getType("uima.cas.String");
+      Type stringType = testTS.getType(UIMAConstants.TYPE_STRING);
       List<Feature> features = fs.getType().getFeatures();
       for (Feature feature : features) {
         Type range = feature.getRange();
@@ -155,7 +156,7 @@ public class StringFeatureCasEvaluator i
 
   private Collection<FeatureStructure> getFeatureStructures(List<Type> types, CAS cas) {
     TypeSystem typeSystem = cas.getTypeSystem();
-    Type stringType = typeSystem.getType("uima.cas.String");
+    Type stringType = typeSystem.getType(UIMAConstants.TYPE_STRING);
     Collection<FeatureStructure> result = new HashSet<FeatureStructure>();
     for (Type type : types) {
       FSIterator<FeatureStructure> iterator = cas.getIndexRepository().getAllIndexedFS(type);
@@ -191,7 +192,7 @@ public class StringFeatureCasEvaluator i
     }
     CAS cas = a1.getCAS();
     TypeSystem typeSystem = cas.getTypeSystem();
-    Type stringType = typeSystem.getType("uima.cas.String");
+    Type stringType = typeSystem.getType(UIMAConstants.TYPE_STRING);
     List<Feature> features1 = type1.getFeatures();
     boolean result = true;
     boolean allEmpty1 = true;

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/UIMAConstants.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/UIMAConstants.java?rev=1229104&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/UIMAConstants.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/UIMAConstants.java Mon Jan  9 12:08:45 2012
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.uima.textmarker;
+
+public class UIMAConstants {
+  
+  public static final String TYPE_INTEGER = "uima.cas.Integer";
+
+  public static final String TYPE_FLOAT = "uima.cas.Float";
+
+  public static final String TYPE_BOOLEAN = "uima.cas.Boolean";
+
+  public static final String TYPE_BYTE = "uima.cas.Byte";
+
+  public static final String TYPE_SHORT = "uima.cas.Short";
+
+  public static final String TYPE_LONG = "uima.cas.Long";
+
+  public static final String TYPE_DOUBLE = "uima.cas.Double";
+
+  public static final String TYPE_STRING = "uima.cas.String";
+
+}

Modified: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/AbstractStructureAction.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/AbstractStructureAction.java?rev=1229104&r1=1229103&r2=1229104&view=diff
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/AbstractStructureAction.java (original)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/AbstractStructureAction.java Mon Jan  9 12:08:45 2012
@@ -32,6 +32,7 @@ import org.apache.uima.jcas.JCas;
 import org.apache.uima.jcas.cas.FSArray;
 import org.apache.uima.jcas.cas.TOP;
 import org.apache.uima.textmarker.TextMarkerStream;
+import org.apache.uima.textmarker.UIMAConstants;
 import org.apache.uima.textmarker.expression.TextMarkerExpression;
 import org.apache.uima.textmarker.expression.bool.BooleanExpression;
 import org.apache.uima.textmarker.expression.number.NumberExpression;
@@ -64,11 +65,11 @@ public abstract class AbstractStructureA
       Object valueObject = map.get(shortFName);
       Type range = targetFeature.getRange();
       if (valueObject != null) {
-        if (valueObject instanceof StringExpression && range.getName().equals("uima.cas.String")) {
+        if (valueObject instanceof StringExpression && range.getName().equals(UIMAConstants.TYPE_STRING)) {
           structure.setStringValue(targetFeature,
                   ((StringExpression) valueObject).getStringValue(element.getParent()));
         } else if (valueObject instanceof TypeExpression
-                && range.getName().equals("uima.cas.String")) {
+                && range.getName().equals(UIMAConstants.TYPE_STRING)) {
           TypeExpression type = (TypeExpression) valueObject;
           List<AnnotationFS> annotationsInWindow = stream.getAnnotationsInWindow(matchedAnnotation,
                   type.getType(element.getParent()));
@@ -77,15 +78,15 @@ public abstract class AbstractStructureA
             structure.setStringValue(targetFeature, annotation.getCoveredText());
           }
         } else if (valueObject instanceof NumberExpression
-                && range.getName().equals("uima.cas.Integer")) {
+                && range.getName().equals(UIMAConstants.TYPE_INTEGER)) {
           structure.setIntValue(targetFeature,
                   ((NumberExpression) valueObject).getIntegerValue(element.getParent()));
         } else if (valueObject instanceof NumberExpression
-                && range.getName().equals("uima.cas.Double")) {
+                && range.getName().equals(UIMAConstants.TYPE_DOUBLE)) {
           structure.setDoubleValue(targetFeature,
                   ((NumberExpression) valueObject).getDoubleValue(element.getParent()));
         } else if (valueObject instanceof BooleanExpression
-                && range.getName().equals("uima.cas.Boolean")) {
+                && range.getName().equals(UIMAConstants.TYPE_BOOLEAN)) {
           structure.setBooleanValue(targetFeature,
                   ((BooleanExpression) valueObject).getBooleanValue(element.getParent()));
         } else if (valueObject instanceof TypeExpression) {

Modified: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/GetFeatureAction.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/GetFeatureAction.java?rev=1229104&r1=1229103&r2=1229104&view=diff
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/GetFeatureAction.java (original)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/GetFeatureAction.java Mon Jan  9 12:08:45 2012
@@ -27,6 +27,7 @@ import org.apache.uima.cas.Type;
 import org.apache.uima.cas.text.AnnotationFS;
 import org.apache.uima.textmarker.TextMarkerEnvironment;
 import org.apache.uima.textmarker.TextMarkerStream;
+import org.apache.uima.textmarker.UIMAConstants;
 import org.apache.uima.textmarker.expression.string.StringExpression;
 import org.apache.uima.textmarker.rule.RuleElement;
 import org.apache.uima.textmarker.rule.RuleMatch;
@@ -68,23 +69,23 @@ public class GetFeatureAction extends Ab
         }
 
         if (environment.getVariableType(variable).equals(String.class)
-                && featureByBaseName.getRange().getName().equals("uima.cas.String")) {
+                && featureByBaseName.getRange().getName().equals(UIMAConstants.TYPE_STRING)) {
           Object value = annotationFS.getStringValue(featureByBaseName);
           environment.setVariableValue(variable, value);
         } else if (environment.getVariableType(variable).equals(Integer.class)
-                && featureByBaseName.getRange().getName().equals("uima.cas.Integer")) {
+                && featureByBaseName.getRange().getName().equals(UIMAConstants.TYPE_INTEGER)) {
           Object value = annotationFS.getIntValue(featureByBaseName);
           environment.setVariableValue(variable, value);
         } else if (environment.getVariableType(variable).equals(Double.class)
-                && featureByBaseName.getRange().getName().equals("uima.cas.Double")) {
+                && featureByBaseName.getRange().getName().equals(UIMAConstants.TYPE_DOUBLE)) {
           Object value = annotationFS.getDoubleValue(featureByBaseName);
           environment.setVariableValue(variable, value);
         } else if (environment.getVariableType(variable).equals(Boolean.class)
-                && featureByBaseName.getRange().getName().equals("uima.cas.Boolean")) {
+                && featureByBaseName.getRange().getName().equals(UIMAConstants.TYPE_BOOLEAN)) {
           Object value = annotationFS.getBooleanValue(featureByBaseName);
           environment.setVariableValue(variable, value);
         } else if (environment.getVariableType(variable).equals(Type.class)
-                && featureByBaseName.getRange().getName().equals("uima.cas.String")) {
+                && featureByBaseName.getRange().getName().equals(UIMAConstants.TYPE_STRING)) {
           Object value = annotationFS.getStringValue(featureByBaseName);
           Type t = stream.getCas().getTypeSystem().getType((String) value);
           if (t != null) {

Modified: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/MarkTableAction.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/MarkTableAction.java?rev=1229104&r1=1229103&r2=1229104&view=diff
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/MarkTableAction.java (original)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/MarkTableAction.java Mon Jan  9 12:08:45 2012
@@ -32,6 +32,7 @@ import org.apache.uima.jcas.cas.TOP;
 import org.apache.uima.jcas.tcas.Annotation;
 import org.apache.uima.textmarker.TextMarkerBlock;
 import org.apache.uima.textmarker.TextMarkerStream;
+import org.apache.uima.textmarker.UIMAConstants;
 import org.apache.uima.textmarker.expression.number.NumberExpression;
 import org.apache.uima.textmarker.expression.resource.WordTableExpression;
 import org.apache.uima.textmarker.expression.string.StringExpression;
@@ -103,15 +104,15 @@ public class MarkTableAction extends Abs
       Type range = targetFeature.getRange();
       if (entryIndex != null && row.size() >= entryIndex) {
         String value = row.get(entryIndex - 1);
-        if (range.getName().equals("uima.cas.String")) {
+        if (range.getName().equals(UIMAConstants.TYPE_STRING)) {
           structure.setStringValue(targetFeature, value);
-        } else if (range.getName().equals("uima.cas.Integer")) {
+        } else if (range.getName().equals(UIMAConstants.TYPE_INTEGER)) {
           Integer integer = Integer.parseInt(value);
           structure.setIntValue(targetFeature, integer);
-        } else if (range.getName().equals("uima.cas.Double")) {
+        } else if (range.getName().equals(UIMAConstants.TYPE_DOUBLE)) {
           Double d = Double.parseDouble(value);
           structure.setDoubleValue(targetFeature, d);
-        } else if (range.getName().equals("uima.cas.Boolean")) {
+        } else if (range.getName().equals(UIMAConstants.TYPE_BOOLEAN)) {
           Boolean b = Boolean.parseBoolean(value);
           structure.setBooleanValue(targetFeature, b);
         } else {

Modified: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/SetFeatureAction.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/SetFeatureAction.java?rev=1229104&r1=1229103&r2=1229104&view=diff
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/SetFeatureAction.java (original)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/SetFeatureAction.java Mon Jan  9 12:08:45 2012
@@ -26,6 +26,7 @@ import org.apache.uima.cas.Feature;
 import org.apache.uima.cas.Type;
 import org.apache.uima.cas.text.AnnotationFS;
 import org.apache.uima.textmarker.TextMarkerStream;
+import org.apache.uima.textmarker.UIMAConstants;
 import org.apache.uima.textmarker.expression.bool.BooleanExpression;
 import org.apache.uima.textmarker.expression.number.NumberExpression;
 import org.apache.uima.textmarker.expression.string.StringExpression;
@@ -120,10 +121,10 @@ public class SetFeatureAction extends Ab
           annotationFS.setStringValue(featureByBaseName, string);
         } else if (numberExpr != null) {
           String range = featureByBaseName.getRange().getName();
-          if (range.equals("uima.cas.Integer")) {
+          if (range.equals(UIMAConstants.TYPE_INTEGER)) {
             int v = numberExpr.getIntegerValue(element.getParent());
             annotationFS.setIntValue(featureByBaseName, v);
-          } else if (range.equals("uima.cas.Double")) {
+          } else if (range.equals(UIMAConstants.TYPE_DOUBLE)) {
             double v = numberExpr.getDoubleValue(element.getParent());
             annotationFS.setDoubleValue(featureByBaseName, v);
           }

Modified: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/condition/FeatureCondition.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/condition/FeatureCondition.java?rev=1229104&r1=1229103&r2=1229104&view=diff
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/condition/FeatureCondition.java (original)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/condition/FeatureCondition.java Mon Jan  9 12:08:45 2012
@@ -22,6 +22,7 @@ package org.apache.uima.textmarker.condi
 import org.apache.uima.cas.Feature;
 import org.apache.uima.cas.text.AnnotationFS;
 import org.apache.uima.textmarker.TextMarkerStream;
+import org.apache.uima.textmarker.UIMAConstants;
 import org.apache.uima.textmarker.expression.bool.BooleanExpression;
 import org.apache.uima.textmarker.expression.number.NumberExpression;
 import org.apache.uima.textmarker.expression.string.StringExpression;
@@ -82,11 +83,11 @@ public class FeatureCondition extends Ab
     } else if (numberExpr != null) {
       String range = featureByBaseName.getRange().getName();
       boolean result = false;
-      if (range.equals("uima.cas.Integer")) {
+      if (range.equals(UIMAConstants.TYPE_INTEGER)) {
         int value = annotation.getIntValue(featureByBaseName);
         int v = numberExpr.getIntegerValue(element.getParent());
         result = value == v;
-      } else if (range.equals("uima.cas.Double")) {
+      } else if (range.equals(UIMAConstants.TYPE_DOUBLE)) {
         double value = annotation.getDoubleValue(featureByBaseName);
         double v = numberExpr.getDoubleValue(element.getParent());
         result = value == v;

Modified: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/core/TextMarkerKeywords.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/core/TextMarkerKeywords.java?rev=1229104&r1=1229103&r2=1229104&view=diff
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/core/TextMarkerKeywords.java (original)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/core/TextMarkerKeywords.java Mon Jan  9 12:08:45 2012
@@ -27,8 +27,8 @@ public class TextMarkerKeywords implemen
       "AFTER", "STARTSWITH", "ENDSWITH", "PARTOFNEQ", "SIZE" };
 
   private static String[] declaration = { "WORDLIST", "DECLARE", "BOOLEAN", "PACKAGE", "TYPE",
-      "TYPESYSTEM", "INT", "DOUBLE", "STRING", "SCRIPT", "WORDTABLE", "ENGINE", "ACTION",
-      "CONDITION", "BLOCK", "RULES", "BOOLEANLIST", "INTLIST", "DOUBLELIST", "STRINGLIST",
+      "TYPESYSTEM", "INT", "DOUBLE", "FLOAT", "STRING", "SCRIPT", "WORDTABLE", "ENGINE", "ACTION",
+      "CONDITION", "BLOCK", "RULES", "BOOLEANLIST", "INTLIST", "DOUBLELIST", "FLOATLIST","STRINGLIST",
       "TYPELIST" };
 
   private static String[] action = { "DEL", "CALL", "MARK", "MARKSCORE", "COLOR", "LOG", "TAG",

Modified: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/core/builder/TextMarkerSimpleBuilder.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/core/builder/TextMarkerSimpleBuilder.java?rev=1229104&r1=1229103&r2=1229104&view=diff
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/core/builder/TextMarkerSimpleBuilder.java (original)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/core/builder/TextMarkerSimpleBuilder.java Mon Jan  9 12:08:45 2012
@@ -49,6 +49,7 @@ import org.apache.uima.resource.metadata
 import org.apache.uima.resource.metadata.TypeDescription;
 import org.apache.uima.resource.metadata.TypeSystemDescription;
 import org.apache.uima.resource.metadata.impl.Import_impl;
+import org.apache.uima.textmarker.UIMAConstants;
 import org.apache.uima.textmarker.engine.TextMarkerEngine;
 import org.apache.uima.util.CasCreationUtils;
 import org.apache.uima.util.InvalidXMLException;
@@ -295,15 +296,17 @@ public class TextMarkerSimpleBuilder {
     if (name.equals("Annotation")) {
       return "uima.tcas.Annotation";
     } else if (name.equals("STRING")) {
-      return "uima.cas.String";
+      return UIMAConstants.TYPE_STRING;
     } else if (name.equals("INT")) {
-      return "uima.cas.Integer";
+      return UIMAConstants.TYPE_INTEGER;
     } else if (name.equals("DOUBLE")) {
-      return "uima.cas.Double";
+      return UIMAConstants.TYPE_DOUBLE;
+    } else if (name.equals("FLOAT")) {
+      return UIMAConstants.TYPE_FLOAT;
     } else if (name.equals("BOOLEAN")) {
-      return "uima.cas.Boolean";
+      return UIMAConstants.TYPE_BOOLEAN;
     } else if (name.equals("TYPE")) {
-      return "uima.cas.String";
+      return UIMAConstants.TYPE_STRING;
     }
     return name;
   }

Modified: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/parser/ast/TMTypeConstants.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/parser/ast/TMTypeConstants.java?rev=1229104&r1=1229103&r2=1229104&view=diff
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/parser/ast/TMTypeConstants.java (original)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/parser/ast/TMTypeConstants.java Mon Jan  9 12:08:45 2012
@@ -41,6 +41,11 @@ public final class TMTypeConstants {
   public static final int TM_TYPE_D = TM_TYPE_N | 2 << 19;
 
   /**
+   * float
+   */
+  public static final int TM_TYPE_F = TM_TYPE_N | 2 << 28;
+  
+  /**
    * string
    */
   public static final int TM_TYPE_S = 2 << 20;
@@ -100,6 +105,7 @@ public final class TMTypeConstants {
     typeStringOfInt.put(TM_TYPE_B, "BOOLEAN");
     typeStringOfInt.put(TM_TYPE_C, "CONDITION");
     typeStringOfInt.put(TM_TYPE_D, "DOUBLE");
+    typeStringOfInt.put(TM_TYPE_F, "FLOAT");
     typeStringOfInt.put(TM_TYPE_N, "NUMBER");
     typeStringOfInt.put(TM_TYPE_I, "INT");
     typeStringOfInt.put(TM_TYPE_S, "STRING");

Modified: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/validator/TextMarkerTypeChecker.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/validator/TextMarkerTypeChecker.java?rev=1229104&r1=1229103&r2=1229104&view=diff
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/validator/TextMarkerTypeChecker.java (original)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/validator/TextMarkerTypeChecker.java Mon Jan  9 12:08:45 2012
@@ -242,7 +242,7 @@ public class TextMarkerTypeChecker imple
 
           for (TextMarkerFeatureDeclaration each : features) {
             String type = each.getType();
-            if (type.equals("INT") || type.equals("STRING") || type.equals("DOUBLE")
+            if (type.equals("INT") || type.equals("STRING") || type.equals("DOUBLE")|| type.equals("FLOAT")
                     || type.equals("BOOLEAN")) {
               continue;
             }