Package org.apache.uima.ruta.expression.feature

Examples of org.apache.uima.ruta.expression.feature.FeatureMatchExpression


    return new SimpleFeatureExpression(te, featureReferences);
  }

  public static FeatureMatchExpression createFeatureMatchExpression(FeatureExpression f, Token op,
          IRutaExpression arg, RutaBlock env) {
    return new FeatureMatchExpression(f, op.getText(), arg);
  }
View Full Code Here


  private boolean checkFeature(AnnotationFS annotation, RutaStream stream, RutaBlock parent) {
    FeatureExpression fe = mr.getFeatureExpression(parent, stream);
    Feature feature = fe.getFeature(parent);
    if (fe instanceof FeatureMatchExpression) {
      FeatureMatchExpression fme = (FeatureMatchExpression) fe;
      boolean checkFeatureValue = fme.checkFeatureValue(annotation, stream, parent);
      if (checkFeatureValue) {
        return true;
      }
    } else {
      TypeSystem typeSystem = stream.getCas().getTypeSystem();
View Full Code Here

      if (tail != null) {
        if (op == null) {
          featureExpression = new SimpleFeatureExpression(typeExpression, tail);
        } else {
          SimpleFeatureExpression expr = new SimpleFeatureExpression(typeExpression, tail);
          featureExpression = new FeatureMatchExpression(expr, op, arg);
        }
      }
    }
    if(typeExpression == null || typeExpression.getType(parent) == null) {
      throw new IllegalArgumentException("Not able to resolve type of expression: "+ match);
View Full Code Here

          InferenceCrowd crowd) {
    if (expr instanceof IBooleanExpression) {
      IBooleanExpression be = (IBooleanExpression) expr;
      return new EvaluatedCondition(this, be.getBooleanValue(element.getParent(), null, stream));
    } else if (expr instanceof FeatureMatchExpression) {
      FeatureMatchExpression fme = (FeatureMatchExpression) expr;
      TypeExpression typeExpr = fme.getTypeExpr();
      Type type = typeExpr.getType(element.getParent());
      List<AnnotationFS> annotations = getAnnotationsToCheck(annotation, type, fme, stream);
      Collection<AnnotationFS> featureAnnotations = fme.getFeatureAnnotations(annotations, stream,
              element.getParent(), true);
      return new EvaluatedCondition(this, !featureAnnotations.isEmpty());
    }
    return new EvaluatedCondition(this, false);
  }
View Full Code Here

  private boolean checkFeature(AnnotationFS annotation, RutaStream stream, RutaBlock parent) {
    FeatureExpression fe = mr.getFeatureExpression(parent, stream);
    Feature feature = fe.getFeature(parent);
    if (fe instanceof FeatureMatchExpression) {
      FeatureMatchExpression fme = (FeatureMatchExpression) fe;
      boolean checkFeatureValue = fme.checkFeatureValue(annotation, stream, parent);
      if (checkFeatureValue) {
        return true;
      }
    } else {
      TypeSystem typeSystem = stream.getCas().getTypeSystem();
View Full Code Here

      if (tail != null) {
        if (op == null) {
          featureExpression = new SimpleFeatureExpression(typeExpression, tail);
        } else {
          SimpleFeatureExpression expr = new SimpleFeatureExpression(typeExpression, tail);
          featureExpression = new FeatureMatchExpression(expr, op, arg);
        }
      }
    }
  }
View Full Code Here

          InferenceCrowd crowd) {
    if (expr instanceof BooleanExpression) {
      BooleanExpression be = (BooleanExpression) expr;
      return new EvaluatedCondition(this, be.getBooleanValue(element.getParent(), null, stream));
    } else if (expr instanceof FeatureMatchExpression) {
      FeatureMatchExpression fme = (FeatureMatchExpression) expr;
      TypeExpression typeExpr = fme.getTypeExpr();
      Type type = typeExpr.getType(element.getParent());
      List<AnnotationFS> annotations = getAnnotationsToCheck(annotation, type, fme, stream);
      Collection<AnnotationFS> featureAnnotations = fme.getFeatureAnnotations(annotations, stream,
              element.getParent(), true);
      return new EvaluatedCondition(this, !featureAnnotations.isEmpty());
    }
    return new EvaluatedCondition(this, false);
  }
View Full Code Here

    return new SimpleFeatureExpression(te, featureReferences);
  }

  public static FeatureMatchExpression createFeatureMatchExpression(FeatureExpression f, Token op,
          RutaExpression arg, RutaBlock env) {
    return new FeatureMatchExpression(f, op.getText(), arg);
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.ruta.expression.feature.FeatureMatchExpression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.