Examples of TotalCountCondition


Examples of org.apache.uima.ruta.condition.TotalCountCondition

    c = new StartsWithCondition(typeListExpr);
    s = v.verbalize(c);
    assertEquals("STARTSWITH({Type1, typeVar})", s);

    // TOTALCOUNT
    c = new TotalCountCondition(typeExpr1, numExpr1, numExpr2, var);
    s = v.verbalize(c);
    assertEquals("TOTALCOUNT(Type1, 4, numVar, anyVar)", s);

    // VOTE
    c = new VoteCondition(typeExpr1, typeExpr2);
View Full Code Here

Examples of org.apache.uima.ruta.condition.TotalCountCondition

      INumberExpression maxE = c.getMax();
      String max = verbalizeMax(maxE, Integer.MAX_VALUE);
      String var = c.getVar() == null ? "" : ", " + c.getVar();
      return name + min.substring(2) + max + var + ")";
    } else if (condition instanceof TotalCountCondition) {
      TotalCountCondition c = (TotalCountCondition) condition;
      String type = verbalizer.verbalize(c.getType());
      INumberExpression minE = c.getMin();
      String min = verbalizeMin(minE, Integer.MIN_VALUE);
      INumberExpression maxE = c.getMax();
      String max = verbalizeMax(maxE, Integer.MAX_VALUE);
      String var = c.getVar() == null ? "" : ", " + c.getVar();
      return name + type + min + max + var + ")";
    } else if (condition instanceof VoteCondition) {
      VoteCondition c = (VoteCondition) condition;
      String type1 = verbalizer.verbalize(c.getType1());
      String type2 = verbalizer.verbalize(c.getType2());
      return name + type1 + ", " + type2 + ")";
    } else if (condition instanceof FeatureCondition) {
      FeatureCondition c = (FeatureCondition) condition;
      String e1 = verbalizer.verbalize(c.getFeatureStringExpression());
      String e2 = "";
      if (c.getBooleanExpr() != null) {
        e2 = verbalizer.verbalize(c.getBooleanExpr());
      } else if (c.getNumberExpr() != null) {
        e2 = verbalizer.verbalize(c.getNumberExpr());
      } else if (c.getStringExpr() != null) {
        e2 = verbalizer.verbalize(c.getStringExpr());
      }
      return name + e1 + ", " + e2 + ")";
    } else if (condition instanceof ParseCondition) {
      ParseCondition c = (ParseCondition) condition;
      String var = c.getVar();
      return name + var + ")";
    } else if (condition instanceof IsCondition) {
      IsCondition c = (IsCondition) condition;
      String type = "";
      if (c.getType() != null) {
        type = verbalizer.verbalize(c.getType());
      } else {
        type = verbalizer.verbalize(c.getList());
      }
      return name + type + ")";
    } else if (condition instanceof BeforeCondition) {
      BeforeCondition c = (BeforeCondition) condition;
      String type = "";
      if (c.getType() != null) {
        type = verbalizer.verbalize(c.getType());
      } else {
        type = verbalizer.verbalize(c.getList());
      }
      return name + type + ")";
    } else if (condition instanceof AfterCondition) {
      AfterCondition c = (AfterCondition) condition;
      String type = "";
      if (c.getType() != null) {
        type = verbalizer.verbalize(c.getType());
      } else {
        type = verbalizer.verbalize(c.getList());
      }
      return name + type + ")";
    } else if (condition instanceof StartsWithCondition) {
      StartsWithCondition c = (StartsWithCondition) condition;
      String arg = "";
      if (c.getType() != null) {
        arg = verbalizer.verbalize(c.getType());
      } else {
        arg = verbalizer.verbalize(c.getList());
      }
      return name + arg + ")";
    } else if (condition instanceof EndsWithCondition) {
      EndsWithCondition c = (EndsWithCondition) condition;
      String type = "";
      if (c.getType() != null) {
        type = verbalizer.verbalize(c.getType());
      } else {
        type = verbalizer.verbalize(c.getList());
      }
      return name + type + ")";
    } else if (condition instanceof SizeCondition) {
      SizeCondition c = (SizeCondition) condition;
      INumberExpression minE = c.getMinExpr();
      String min = verbalizeMin(minE, Integer.MIN_VALUE);
      INumberExpression maxE = c.getMaxExpr();
      String max = verbalizeMax(maxE, Integer.MAX_VALUE);
      String var = c.getVarExpr() == null ? "" : ", " + c.getVarExpr();
      ListExpression<?> listExpr = c.getListExpr();
      if (listExpr == null) {
        return name + min + max + var + ")";
      } else {
        String l = verbalizer.verbalize(listExpr);
        return name + l + min + max + var + ")";
      }
    } else if (condition instanceof ImplicitCondition) {
      ImplicitCondition c = (ImplicitCondition) condition;
      return verbalizer.verbalize(c.getExpr());
    }

    return condition.getClass().getSimpleName();
  }
View Full Code Here

Examples of org.apache.uima.ruta.condition.TotalCountCondition

    c = new StartsWithCondition(typeListExpr);
    s = v.verbalize(c);
    assertEquals("STARTSWITH({Type1, typeVar})", s);

    // TOTALCOUNT
    c = new TotalCountCondition(typeExpr1, numExpr1, numExpr2, var);
    s = v.verbalize(c);
    assertEquals("TOTALCOUNT(Type1, 4, numVar, anyVar)", s);

    // VOTE
    c = new VoteCondition(typeExpr1, typeExpr2);
View Full Code Here

Examples of org.apache.uima.ruta.condition.TotalCountCondition

      NumberExpression maxE = c.getMax();
      String max = verbalizeMax(maxE, Integer.MAX_VALUE);
      String var = c.getVar() == null ? "" : ", " + c.getVar();
      return name + min.substring(2) + max + var + ")";
    } else if (condition instanceof TotalCountCondition) {
      TotalCountCondition c = (TotalCountCondition) condition;
      String type = verbalizer.verbalize(c.getType());
      NumberExpression minE = c.getMin();
      String min = verbalizeMin(minE, Integer.MIN_VALUE);
      NumberExpression maxE = c.getMax();
      String max = verbalizeMax(maxE, Integer.MAX_VALUE);
      String var = c.getVar() == null ? "" : ", " + c.getVar();
      return name + type + min + max + var + ")";
    } else if (condition instanceof VoteCondition) {
      VoteCondition c = (VoteCondition) condition;
      String type1 = verbalizer.verbalize(c.getType1());
      String type2 = verbalizer.verbalize(c.getType2());
      return name + type1 + ", " + type2 + ")";
    } else if (condition instanceof FeatureCondition) {
      FeatureCondition c = (FeatureCondition) condition;
      String e1 = verbalizer.verbalize(c.getFeatureStringExpression());
      String e2 = "";
      if (c.getBooleanExpr() != null) {
        e2 = verbalizer.verbalize(c.getBooleanExpr());
      } else if (c.getNumberExpr() != null) {
        e2 = verbalizer.verbalize(c.getNumberExpr());
      } else if (c.getStringExpr() != null) {
        e2 = verbalizer.verbalize(c.getStringExpr());
      }
      return name + e1 + ", " + e2 + ")";
    } else if (condition instanceof ParseCondition) {
      ParseCondition c = (ParseCondition) condition;
      String var = c.getVar();
      return name + var + ")";
    } else if (condition instanceof IsCondition) {
      IsCondition c = (IsCondition) condition;
      String type = "";
      if (c.getType() != null) {
        type = verbalizer.verbalize(c.getType());
      } else {
        type = verbalizer.verbalize(c.getList());
      }
      return name + type + ")";
    } else if (condition instanceof BeforeCondition) {
      BeforeCondition c = (BeforeCondition) condition;
      String type = "";
      if (c.getType() != null) {
        type = verbalizer.verbalize(c.getType());
      } else {
        type = verbalizer.verbalize(c.getList());
      }
      return name + type + ")";
    } else if (condition instanceof AfterCondition) {
      AfterCondition c = (AfterCondition) condition;
      String type = "";
      if (c.getType() != null) {
        type = verbalizer.verbalize(c.getType());
      } else {
        type = verbalizer.verbalize(c.getList());
      }
      return name + type + ")";
    } else if (condition instanceof StartsWithCondition) {
      StartsWithCondition c = (StartsWithCondition) condition;
      String arg = "";
      if (c.getType() != null) {
        arg = verbalizer.verbalize(c.getType());
      } else {
        arg = verbalizer.verbalize(c.getList());
      }
      return name + arg + ")";
    } else if (condition instanceof EndsWithCondition) {
      EndsWithCondition c = (EndsWithCondition) condition;
      String type = "";
      if (c.getType() != null) {
        type = verbalizer.verbalize(c.getType());
      } else {
        type = verbalizer.verbalize(c.getList());
      }
      return name + type + ")";
    } else if (condition instanceof SizeCondition) {
      SizeCondition c = (SizeCondition) condition;
      NumberExpression minE = c.getMinExpr();
      String min = verbalizeMin(minE, Integer.MIN_VALUE);
      NumberExpression maxE = c.getMaxExpr();
      String max = verbalizeMax(maxE, Integer.MAX_VALUE);
      String var = c.getVarExpr() == null ? "" : ", " + c.getVarExpr();
      ListExpression<?> listExpr = c.getListExpr();
      if(listExpr == null) {
        return name + min + max + var + ")";
      } else {
        String l = verbalizer.verbalize(listExpr);
        return name + l + min + max + var + ")";
View Full Code Here

Examples of org.apache.uima.ruta.condition.TotalCountCondition

    c = new StartsWithCondition(typeListExpr);
    s = v.verbalize(c);
    assertEquals("STARTSWITH({Type1, typeVar})", s);

    // TOTALCOUNT
    c = new TotalCountCondition(typeExpr1, numExpr1, numExpr2, var);
    s = v.verbalize(c);
    assertEquals("TOTALCOUNT(Type1, 4, numVar, anyVar)", s);

    // VOTE
    c = new VoteCondition(typeExpr1, typeExpr2);
View Full Code Here

Examples of org.apache.uima.ruta.condition.TotalCountCondition

      NumberExpression maxE = c.getMax();
      String max = verbalizeMax(maxE, Integer.MAX_VALUE);
      String var = c.getVar() == null ? "" : ", " + c.getVar();
      return name + min.substring(2) + max + var + ")";
    } else if (condition instanceof TotalCountCondition) {
      TotalCountCondition c = (TotalCountCondition) condition;
      String type = verbalizer.verbalize(c.getType());
      NumberExpression minE = c.getMin();
      String min = verbalizeMin(minE, Integer.MIN_VALUE);
      NumberExpression maxE = c.getMax();
      String max = verbalizeMax(maxE, Integer.MAX_VALUE);
      String var = c.getVar() == null ? "" : ", " + c.getVar();
      return name + type + min + max + var + ")";
    } else if (condition instanceof VoteCondition) {
      VoteCondition c = (VoteCondition) condition;
      String type1 = verbalizer.verbalize(c.getType1());
      String type2 = verbalizer.verbalize(c.getType2());
      return name + type1 + ", " + type2 + ")";
    } else if (condition instanceof FeatureCondition) {
      FeatureCondition c = (FeatureCondition) condition;
      String e1 = verbalizer.verbalize(c.getFeatureStringExpression());
      String e2 = "";
      if (c.getBooleanExpr() != null) {
        e2 = verbalizer.verbalize(c.getBooleanExpr());
      } else if (c.getNumberExpr() != null) {
        e2 = verbalizer.verbalize(c.getNumberExpr());
      } else if (c.getStringExpr() != null) {
        e2 = verbalizer.verbalize(c.getStringExpr());
      }
      return name + e1 + ", " + e2 + ")";
    } else if (condition instanceof ParseCondition) {
      ParseCondition c = (ParseCondition) condition;
      String var = c.getVar();
      return name + var + ")";
    } else if (condition instanceof IsCondition) {
      IsCondition c = (IsCondition) condition;
      String type = "";
      if (c.getType() != null) {
        type = verbalizer.verbalize(c.getType());
      } else {
        type = verbalizer.verbalize(c.getList());
      }
      return name + type + ")";
    } else if (condition instanceof BeforeCondition) {
      BeforeCondition c = (BeforeCondition) condition;
      String type = "";
      if (c.getType() != null) {
        type = verbalizer.verbalize(c.getType());
      } else {
        type = verbalizer.verbalize(c.getList());
      }
      return name + type + ")";
    } else if (condition instanceof AfterCondition) {
      AfterCondition c = (AfterCondition) condition;
      String type = "";
      if (c.getType() != null) {
        type = verbalizer.verbalize(c.getType());
      } else {
        type = verbalizer.verbalize(c.getList());
      }
      return name + type + ")";
    } else if (condition instanceof StartsWithCondition) {
      StartsWithCondition c = (StartsWithCondition) condition;
      String arg = "";
      if (c.getType() != null) {
        arg = verbalizer.verbalize(c.getType());
      } else {
        arg = verbalizer.verbalize(c.getList());
      }
      return name + arg + ")";
    } else if (condition instanceof EndsWithCondition) {
      EndsWithCondition c = (EndsWithCondition) condition;
      String type = "";
      if (c.getType() != null) {
        type = verbalizer.verbalize(c.getType());
      } else {
        type = verbalizer.verbalize(c.getList());
      }
      return name + type + ")";
    } else if (condition instanceof SizeCondition) {
      SizeCondition c = (SizeCondition) condition;
      NumberExpression minE = c.getMinExpr();
      String min = verbalizeMin(minE, Integer.MIN_VALUE);
      NumberExpression maxE = c.getMaxExpr();
      String max = verbalizeMax(maxE, Integer.MAX_VALUE);
      String var = c.getVarExpr() == null ? "" : ", " + c.getVarExpr();
      ListExpression<?> listExpr = c.getListExpr();
      if (listExpr == null) {
        return name + min + max + var + ")";
      } else {
        String l = verbalizer.verbalize(listExpr);
        return name + l + min + max + var + ")";
      }
    } else if (condition instanceof ImplicitCondition) {
      ImplicitCondition c = (ImplicitCondition) condition;
      return verbalizer.verbalize(c.getExpr());
    }

    return condition.getClass().getSimpleName();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.