Author: pkluegl
Date: Thu Jan 12 12:36:08 2012
New Revision: 1230504

URL: http://svn.apache.org/viewvc?rev=1230504&view=rev
Log:
UIMA-2233
removed RETAINMARKUP, FILTERMARKUP, ISINTAG since their functionality is not 
supported anymore. Html handling will be introduced by additional seeders in 
future. 

Removed:
    
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/FilterMarkupAction.java
    
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/RetainMarkupAction.java
    
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/condition/IsInTagCondition.java
Modified:
    
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/FilterManager.java
    
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/TextMarkerStream.java
    
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/ActionFactory.java
    
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/condition/ConditionFactory.java
    
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/engine/TextMarkerEngine.java
    
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/parser/TextMarkerParser.g
    
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/parser/TextMarkerParser.java
    
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/type/TextMarkerBasic.java
    
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/verbalize/ActionVerbalizer.java
    
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/verbalize/ConditionVerbalizer.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-textruler/src/main/java/org/apache/uima/textmarker/textruler/core/TextRulerBasicLearner.java
    
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-textruler/src/main/java/org/apache/uima/textmarker/textruler/tools/BatchRuleEvaluator.java

Modified: 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/FilterManager.java
URL: 
http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/FilterManager.java?rev=1230504&r1=1230503&r2=1230504&view=diff
==============================================================================
--- 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/FilterManager.java
 (original)
+++ 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/FilterManager.java
 Thu Jan 12 12:36:08 2012
@@ -26,26 +26,20 @@ import java.util.List;
 import java.util.Set;
 
 import org.apache.uima.cas.CAS;
-import org.apache.uima.cas.CASException;
 import org.apache.uima.cas.ConstraintFactory;
 import org.apache.uima.cas.FSIntConstraint;
 import org.apache.uima.cas.FSIterator;
 import org.apache.uima.cas.FSMatchConstraint;
-import org.apache.uima.cas.FSTypeConstraint;
 import org.apache.uima.cas.FeaturePath;
 import org.apache.uima.cas.Type;
 import org.apache.uima.cas.text.AnnotationFS;
 import org.apache.uima.textmarker.constraint.BasicTypeConstraint;
-import org.apache.uima.textmarker.constraint.MarkupConstraint;
 import org.apache.uima.textmarker.constraint.NotConstraint;
-import org.apache.uima.textmarker.type.MARKUP;
 
 public class FilterManager {
 
   private final Collection<Type> defaultFilterTypes;
 
-  private final Collection<String> defaultRetainTags;
-
   private final FSMatchConstraint additionalWindow;
 
   private final AnnotationFS windowAnnotation;
@@ -56,59 +50,35 @@ public class FilterManager {
 
   private Collection<Type> currentRetainTypes;
 
-  private Collection<String> currentFilterTags;
-
-  private Collection<String> currentRetainTags;
-
   private ConstraintFactory cf;
 
-  private Type markupType;
-
-  public FilterManager(Collection<Type> filterTypes, Collection<String> 
filterTags, CAS cas) {
+  public FilterManager(Collection<Type> filterTypes, CAS cas) {
     super();
     this.defaultFilterTypes = filterTypes;
-    this.defaultRetainTags = filterTags;
 
     currentFilterTypes = new ArrayList<Type>();
     currentRetainTypes = new ArrayList<Type>();
-    currentFilterTags = new ArrayList<String>();
-    currentRetainTags = new ArrayList<String>();
 
     cf = cas.getConstraintFactory();
 
     this.windowAnnotation = null;
     this.windowType = null;
     this.additionalWindow = null;
-    try {
-      markupType = cas.getJCas().getCasType(MARKUP.type);
-    } catch (CASException e) {
-      e.printStackTrace();
-    }
   }
 
-  public FilterManager(Collection<Type> defaultFilterTypes, Collection<String> 
defaultFilterTags,
-          Collection<Type> filterTypes, Collection<Type> retainTypes,
-          Collection<String> filterTags, Collection<String> retainTags,
-          AnnotationFS windowAnnotation, Type windowType, CAS cas) {
+  public FilterManager(Collection<Type> defaultFilterTypes, Collection<Type> 
filterTypes,
+          Collection<Type> retainTypes, AnnotationFS windowAnnotation, Type 
windowType, CAS cas) {
     super();
     this.defaultFilterTypes = defaultFilterTypes;
-    this.defaultRetainTags = defaultFilterTags;
 
     currentFilterTypes = new ArrayList<Type>(filterTypes);
     currentRetainTypes = new ArrayList<Type>(retainTypes);
-    currentFilterTags = new ArrayList<String>(filterTags);
-    currentRetainTags = new ArrayList<String>(retainTags);
 
     cf = cas.getConstraintFactory();
 
     this.windowAnnotation = windowAnnotation;
     this.windowType = windowType;
     this.additionalWindow = createWindowConstraint(windowAnnotation, cas);
-    try {
-      markupType = cas.getJCas().getCasType(MARKUP.type);
-    } catch (CASException e) {
-      e.printStackTrace();
-    }
   }
 
   private FSMatchConstraint createWindowConstraint(AnnotationFS 
windowAnnotation, CAS cas) {
@@ -141,31 +111,15 @@ public class FilterManager {
     filterTypes.addAll(currentFilterTypes);
     filterTypes.removeAll(currentRetainTypes);
 
-    Set<String> retainTags = new HashSet<String>();
-    retainTags.addAll(defaultRetainTags);
-    retainTags.addAll(currentRetainTags);
-    retainTags.removeAll(currentFilterTags);
-
     FSMatchConstraint typeConstraint = createTypeConstraint(filterTypes);
-    FSMatchConstraint markupConstraint = createTagConstraint(retainTags);
 
-    FSMatchConstraint constraint = cf.or(new NotConstraint(typeConstraint), 
markupConstraint);
+    FSMatchConstraint constraint = new NotConstraint(typeConstraint);
     if (additionalWindow != null && windowConstraint) {
       constraint = cf.and(additionalWindow, constraint);
     }
     return constraint;
   }
 
-  private FSMatchConstraint createTagConstraint(Collection<String> tags) {
-    FSTypeConstraint constraint = cf.createTypeConstraint();
-    constraint.add(markupType);
-    MarkupConstraint result = new MarkupConstraint(constraint);
-    for (String string : tags) {
-      result.addTag(string);
-    }
-    return result;
-  }
-
   private FSMatchConstraint createTypeConstraint(Collection<Type> types) {
     BasicTypeConstraint result = new 
BasicTypeConstraint(cf.createTypeConstraint(), types);
     for (Type each : types) {
@@ -182,22 +136,10 @@ public class FilterManager {
     currentFilterTypes = list;
   }
 
-  public void retainTags(List<String> list) {
-    currentRetainTags = list;
-  }
-
-  public void filterTags(List<String> list) {
-    currentFilterTags = list;
-  }
-
   public Collection<Type> getDefaultFilterTypes() {
     return defaultFilterTypes;
   }
 
-  public Collection<String> getDefaultRetainTags() {
-    return defaultRetainTags;
-  }
-
   public FSMatchConstraint getAdditionalWindow() {
     return additionalWindow;
   }
@@ -210,14 +152,6 @@ public class FilterManager {
     return currentRetainTypes;
   }
 
-  public Collection<String> getCurrentFilterTags() {
-    return currentFilterTags;
-  }
-
-  public Collection<String> getCurrentRetainTags() {
-    return currentRetainTags;
-  }
-
   public AnnotationFS getWindowAnnotation() {
     return windowAnnotation;
   }

Modified: 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/TextMarkerStream.java
URL: 
http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/TextMarkerStream.java?rev=1230504&r1=1230503&r2=1230504&view=diff
==============================================================================
--- 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/TextMarkerStream.java
 (original)
+++ 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/TextMarkerStream.java
 Thu Jan 12 12:36:08 2012
@@ -117,8 +117,8 @@ public class TextMarkerStream extends FS
     updateIterators(cas, basicType, filter, additionalWindow);
   }
 
-  private void updateIterators(CAS cas,  Type basicType,
-          FilterManager filter, AnnotationFS additionalWindow) {
+  private void updateIterators(CAS cas, Type basicType, FilterManager filter,
+          AnnotationFS additionalWindow) {
     if (additionalWindow != null) {
       this.basicIt = 
cas.getAnnotationIndex(basicType).subiterator(additionalWindow);
     } else {
@@ -255,9 +255,8 @@ public class TextMarkerStream extends FS
     }
 
     FilterManager filterManager = new 
FilterManager(filter.getDefaultFilterTypes(),
-            filter.getDefaultRetainTags(), filter.getCurrentFilterTypes(),
-            filter.getCurrentRetainTypes(), filter.getCurrentFilterTags(),
-            filter.getCurrentRetainTags(), windowAnnotation, windowType, cas);
+            filter.getCurrentFilterTypes(), filter.getCurrentRetainTypes(), 
windowAnnotation,
+            windowType, cas);
     TextMarkerStream stream = new TextMarkerStream(cas, basicIt, basicType, 
filterManager);
     return stream;
   }
@@ -513,18 +512,6 @@ public class TextMarkerStream extends FS
     currentIt = cas.createFilteredIterator(basicIt, defaultConstraint);
   }
 
-  public void retainTags(List<String> list) {
-    filter.retainTags(list);
-    FSMatchConstraint defaultConstraint = filter.getDefaultConstraint();
-    currentIt = cas.createFilteredIterator(basicIt, defaultConstraint);
-  }
-
-  public void filterTags(List<String> list) {
-    filter.filterTags(list);
-    FSMatchConstraint defaultConstraint = filter.getDefaultConstraint();
-    currentIt = cas.createFilteredIterator(basicIt, defaultConstraint);
-  }
-
   public FilterManager getFilter() {
     return filter;
   }
@@ -607,8 +594,7 @@ public class TextMarkerStream extends FS
   }
 
   public TextMarkerStream getCompleteStream() {
-    FilterManager defaultFilter = new 
FilterManager(filter.getDefaultFilterTypes(),
-            filter.getDefaultRetainTags(), getCas());
+    FilterManager defaultFilter = new 
FilterManager(filter.getDefaultFilterTypes(), getCas());
     return new TextMarkerStream(getCas(), basicIt, basicType, defaultFilter);
   }
 

Modified: 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/ActionFactory.java
URL: 
http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/ActionFactory.java?rev=1230504&r1=1230503&r2=1230504&view=diff
==============================================================================
--- 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/ActionFactory.java
 (original)
+++ 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/action/ActionFactory.java
 Thu Jan 12 12:36:08 2012
@@ -61,10 +61,7 @@ public class ActionFactory {
     return new MarkLastAction(type);
   }
 
-  public static AbstractTextMarkerAction 
createRetainMarkupAction(List<StringExpression> markup,
-          TextMarkerBlock parent) {
-    return new RetainMarkupAction(markup);
-  }
+ 
 
   public static AbstractTextMarkerAction 
createRetainTypeAction(List<TypeExpression> types,
           TextMarkerBlock parent) {
@@ -129,11 +126,7 @@ public class ActionFactory {
     return new FilterTypeAction(types);
   }
 
-  public static AbstractTextMarkerAction 
createFilterMarkupAction(List<StringExpression> list,
-          TextMarkerBlock parent) {
-    return new FilterMarkupAction(list);
-  }
-
+ 
   public static AbstractTextMarkerAction 
createSetFeatureAction(StringExpression f, Object v,
           TextMarkerBlock parent) {
     if (v instanceof NumberExpression) {

Modified: 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/condition/ConditionFactory.java
URL: 
http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/condition/ConditionFactory.java?rev=1230504&r1=1230503&r2=1230504&view=diff
==============================================================================
--- 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/condition/ConditionFactory.java
 (original)
+++ 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/condition/ConditionFactory.java
 Thu Jan 12 12:36:08 2012
@@ -100,11 +100,6 @@ public class ConditionFactory {
     return new InListCondition(listExpr, dist, rel);
   }
 
-  public static AbstractTextMarkerCondition 
createConditionIsInTag(StringExpression id,
-          List<StringExpression> list1, List<StringExpression> list2, 
TextMarkerBlock parent) {
-    return new IsInTagCondition(id, list1, list2);
-  }
-
   public static AbstractTextMarkerCondition createConditionMOfN(
           List<AbstractTextMarkerCondition> conds, NumberExpression min, 
NumberExpression max,
           TextMarkerBlock parent) {

Modified: 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/engine/TextMarkerEngine.java
URL: 
http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/engine/TextMarkerEngine.java?rev=1230504&r1=1230503&r2=1230504&view=diff
==============================================================================
--- 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/engine/TextMarkerEngine.java
 (original)
+++ 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/engine/TextMarkerEngine.java
 Thu Jan 12 12:36:08 2012
@@ -112,8 +112,6 @@ public class TextMarkerEngine extends JC
 
   public static final String DEFAULT_FILTERED_TYPES = "defaultFilteredTypes";
 
-  public static final String DEFAULT_FILTERED_MARKUPS = 
"defaultFilteredMarkups";
-
   public static final String DYNAMIC_ANCHORING = "dynamicAnchoring";
 
   public static final String RELOAD_SCRIPT = "reloadScript";
@@ -152,8 +150,6 @@ public class TextMarkerEngine extends JC
 
   private String[] defaultFilteredTypes;
 
-  private String[] defaultFilteredMarkups;
-
   private String mainScript;
 
   private String[] scriptPaths;
@@ -200,7 +196,6 @@ public class TextMarkerEngine extends JC
     resourcePaths = (String[]) 
aContext.getConfigParameterValue(RESOURCE_PATHS);
     scriptEncoding = (String) 
aContext.getConfigParameterValue(SCRIPT_ENCODING);
     defaultFilteredTypes = (String[]) 
aContext.getConfigParameterValue(DEFAULT_FILTERED_TYPES);
-    defaultFilteredMarkups = (String[]) 
aContext.getConfigParameterValue(DEFAULT_FILTERED_MARKUPS);
     dynamicAnchoring = (Boolean) 
aContext.getConfigParameterValue(DYNAMIC_ANCHORING);
     reloadScript = (Boolean) aContext.getConfigParameterValue(RELOAD_SCRIPT);
 
@@ -213,8 +208,6 @@ public class TextMarkerEngine extends JC
 
     scriptEncoding = scriptEncoding == null ? "UTF-8" : scriptEncoding;
     defaultFilteredTypes = defaultFilteredTypes == null ? new String[0] : 
defaultFilteredTypes;
-    defaultFilteredMarkups = defaultFilteredMarkups == null ? new String[0]
-            : defaultFilteredMarkups;
     dynamicAnchoring = dynamicAnchoring == null ? false : dynamicAnchoring;
     reloadScript = reloadScript == null ? false : reloadScript;
 
@@ -372,8 +365,6 @@ public class TextMarkerEngine extends JC
 
   private TextMarkerStream initializeStream(CAS cas) throws 
AnalysisEngineProcessException {
     Collection<Type> filterTypes = new ArrayList<Type>();
-    Collection<String> filterTags = Arrays.asList(defaultFilteredMarkups);
-
     TypeSystem typeSystem = cas.getTypeSystem();
     for (String each : defaultFilteredTypes) {
       Type type = typeSystem.getType(each);
@@ -381,10 +372,8 @@ public class TextMarkerEngine extends JC
         filterTypes.add(type);
       }
     }
-    FilterManager filter = new FilterManager(filterTypes, filterTags, cas);
-
+    FilterManager filter = new FilterManager(filterTypes, cas);
     Type basicType = typeSystem.getType(BASIC_TYPE);
-
     seedAnnotations(cas);
     TextMarkerStream stream = new TextMarkerStream(cas, basicType, filter);
     stream.initalizeBasics();

Modified: 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/parser/TextMarkerParser.g
URL: 
http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/parser/TextMarkerParser.g?rev=1230504&r1=1230503&r2=1230504&view=diff
==============================================================================
--- 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/parser/TextMarkerParser.g
 (original)
+++ 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-engine/src/main/java/org/apache/uima/textmarker/parser/TextMarkerParser.g
 Thu Jan 12 12:36:08 2012
@@ -851,7 +851,6 @@ condition  returns [AbstractTextMarkerCo
        | c = conditionCount
        | c = conditionCurrentCount
        | c = conditionInList
-       | c = conditionIsInTag
        | c = conditionLast
        | c = conditionMofN
        | c = conditionNear
@@ -953,15 +952,7 @@ conditionInList returns [AbstractTextMar
     {if(list1 != null) {cond = ConditionFactory.createConditionInList(list1, 
dist, rel,$blockDeclaration::env);}
     else {cond = ConditionFactory.createConditionInList(list2, dist, 
rel,$blockDeclaration::env);};}
     ;
-conditionIsInTag returns [AbstractTextMarkerCondition cond = null]
-@init {
-List<StringExpression> list1 = new ArrayList<StringExpression>();
-List<StringExpression> list2 = new ArrayList<StringExpression>();
-}
-    :
-    ISINTAG LPAREN id = stringExpression (COMMA id1 = stringExpression 
ASSIGN_EQUAL id2 = stringExpression {list1.add(id1);list2.add(id2);})* RPAREN
-    {cond = ConditionFactory.createConditionIsInTag(id, list1, 
list2,$blockDeclaration::env);} 
-    ;
+
     
 conditionLast returns [AbstractTextMarkerCondition cond = null]
     :   
@@ -1092,9 +1083,7 @@ action  returns [AbstractTextMarkerActio
        | a = actionMarkFast
        | a = actionMarkLast
        | a = actionReplace
-       | a = actionFilterMarkup
        | a = actionFilterType
-       | a = actionRetainMarkup
        | a = actionRetainType
        | a = actionCreate
        | a = actionFill
@@ -1318,15 +1307,7 @@ actionReplace returns [AbstractTextMarke
     {action = ActionFactory.createReplaceAction(lit, $blockDeclaration::env);}
     ;
     
-actionRetainMarkup returns [AbstractTextMarkerAction action = null]
-@init {
-List<StringExpression> list = new ArrayList<StringExpression>();
-}
-    :   
-    RETAINMARKUP (LPAREN id = stringExpression {list.add(id);} (COMMA id = 
stringExpression {list.add(id);})* RPAREN)?
-    {action = 
ActionFactory.createRetainMarkupAction(list,$blockDeclaration::env);}
-    ;
-    
+  
 
 actionRetainType returns [AbstractTextMarkerAction action = null]
 @init {
@@ -1337,15 +1318,7 @@ List<TypeExpression> list = new ArrayLis
     {action = ActionFactory.createRetainTypeAction(list, 
$blockDeclaration::env);}
     ;   
     
-actionFilterMarkup returns [AbstractTextMarkerAction action = null]
-@init {
-List<StringExpression> list = new ArrayList<StringExpression>();
-}
-    :   
-    FILTERMARKUP (LPAREN id = stringExpression {list.add(id);} (COMMA id = 
stringExpression {list.add(id);})* RPAREN)?
-    {action = 
ActionFactory.createFilterMarkupAction(list,$blockDeclaration::env);}
-    ;
-    
+ 
 
 actionFilterType returns [AbstractTextMarkerAction action = null]
 @init {


Reply via email to