Package org.apache.uima.ruta.action

Examples of org.apache.uima.ruta.action.GetListAction


    a = new GetFeatureAction(stringExpr, var);
    s = v.verbalize(a);
    assertEquals("GETFEATURE(\"string\", anyVar)", s);

    // GETLIST
    a = new GetListAction(var, stringExpr);
    s = v.verbalize(a);
    assertEquals("GETLIST(anyVar, \"string\")", s);

    // LOG
    a = new LogAction(stringExpr, Level.INFO);
View Full Code Here


      if (active2 != null) {
        pa2 = ", " + verbalizer.verbalize(active2);
      }
      return name + pa + pa2 + ")";
    } else if (action instanceof GetListAction) {
      GetListAction a = (GetListAction) action;
      String var = a.getVar();
      String op = verbalizer.verbalize(a.getOpExpr());
      return name + var + ", " + op + ")";
    } else if (action instanceof MarkTableAction) {
      MarkTableAction a = (MarkTableAction) action;
      TypeExpression typeExpr = a.getTypeExpr();
      INumberExpression indexExpr = a.getIndexExpr();
      WordTableExpression tableExpr = a.getTableExpr();
      Map<IStringExpression, INumberExpression> featureMap = a.getFeatureMap();
      IBooleanExpression ignoreCase = a.getIgnoreCase();
      INumberExpression ignoreLength = a.getIgnoreLength();
      IStringExpression ignoreChar = a.getIgnoreChar();
      INumberExpression maxIgnoreChar = a.getMaxIgnoreChar();

      String type = verbalizer.verbalize(typeExpr);
      String index = verbalizer.verbalize(indexExpr);
      String table = verbalizer.verbalize(tableExpr);
      String map = "";
      if (featureMap != null) {
        map += ", ";
        for (IStringExpression each : featureMap.keySet()) {
          map += verbalizer.verbalize(each);
          map += " = ";
          map += verbalizer.verbalize(featureMap.get(each));
          map += ", ";
        }
      }
      String icase = ignoreCase == null ? "" : ", " + verbalizer.verbalize(ignoreCase);
      String ilength = ignoreCase == null ? "" : ", " + verbalizer.verbalize(ignoreLength);
      String ichar = ignoreCase == null ? "" : ", " + verbalizer.verbalize(ignoreChar);
      String mic = ignoreCase == null ? "" : ", " + verbalizer.verbalize(maxIgnoreChar);

      return name + type + ", " + index + ", " + table + map + icase + ilength + ichar + mic + ")";
    } else if (action instanceof MatchedTextAction) {
      MatchedTextAction a = (MatchedTextAction) action;
      String var = a.getVar();
      List<INumberExpression> list = a.getList();
      String indexes = list == null ? "" : ", " + verbalizer.verbalizeExpressionList(list);
      return name + var + indexes + ")";
    } else if (action instanceof RemoveDuplicateAction) {
      RemoveDuplicateAction a = (RemoveDuplicateAction) action;
      String listExpr = a.getListExpr();
      return name + listExpr + ")";
    } else if (action instanceof UnmarkAllAction) {
      UnmarkAllAction a = (UnmarkAllAction) action;
      String verbalize = verbalizer.verbalize(a.getType());
      String but = a.getList() == null ? "" : ", " + verbalizer.verbalize(a.getList());
      return name + verbalize + but + ")";
    } else if (action instanceof TrimAction) {
      TrimAction a = (TrimAction) action;
      TypeListExpression typeList = a.getTypeList();
      String verbalize = "";
      if (typeList != null) {
        verbalize = verbalizer.verbalize(typeList);
      } else if (a.getTypes() != null) {
        verbalize = verbalizer.verbalizeExpressionList(a.getTypes());
      }
      return name + verbalize + ")";
    } else if (action instanceof ImplicitMarkAction) {
      ImplicitMarkAction a = (ImplicitMarkAction) action;
      return verbalizer.verbalize(a.getType());
    } else if (action instanceof ImplicitFeatureAction) {
      ImplicitFeatureAction a = (ImplicitFeatureAction) action;
      return verbalizer.verbalize(a.getExpr());
    }

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

      String pa = verbalizer.verbalize(active);
      String pp = panelty == null ? "" : ", " + verbalizer.verbalize(panelty);
      String pf = factor == null ? "" : ", " + verbalizer.verbalize(factor);
      return name + pa + pp + pf + ")";
    } else if (action instanceof GetListAction) {
      GetListAction a = (GetListAction) action;
      String var = a.getVar();
      String op = verbalizer.verbalize(a.getOpExpr());
      return name + var + ", " + op + ")";
    } else if (action instanceof MarkTableAction) {
      MarkTableAction a = (MarkTableAction) action;
      TypeExpression typeExpr = a.getTypeExpr();
      NumberExpression indexExpr = a.getIndexExpr();
      WordTableExpression tableExpr = a.getTableExpr();
      Map<StringExpression, NumberExpression> featureMap = a.getFeatureMap();
      BooleanExpression ignoreCase = a.getIgnoreCase();
      NumberExpression ignoreLength = a.getIgnoreLength();
      StringExpression ignoreChar = a.getIgnoreChar();
      NumberExpression maxIgnoreChar = a.getMaxIgnoreChar();

      String type = verbalizer.verbalize(typeExpr);
      String index = verbalizer.verbalize(indexExpr);
      String table = verbalizer.verbalize(tableExpr);
      String map = "";
      if (featureMap != null) {
        map += ", ";
        for (StringExpression each : featureMap.keySet()) {
          map += verbalizer.verbalize(each);
          map += " = ";
          map += verbalizer.verbalize(featureMap.get(each));
          map += ", ";
        }
      }
      String icase = ignoreCase == null ? "" : ", " + verbalizer.verbalize(ignoreCase);
      String ilength = ignoreCase == null ? "" : ", " + verbalizer.verbalize(ignoreLength);
      String ichar = ignoreCase == null ? "" : ", " + verbalizer.verbalize(ignoreChar);
      String mic = ignoreCase == null ? "" : ", " + verbalizer.verbalize(maxIgnoreChar);

      return name + type + ", " + index + ", " + table + map + icase + ilength + ichar + mic + ")";
    } else if (action instanceof MatchedTextAction) {
      MatchedTextAction a = (MatchedTextAction) action;
      String var = a.getVar();
      List<NumberExpression> list = a.getList();
      String indexes = list == null ? "" : ", " + verbalizer.verbalizeExpressionList(list);
      return name + var + indexes + ")";
    } else if (action instanceof RemoveDuplicateAction) {
      RemoveDuplicateAction a = (RemoveDuplicateAction) action;
      String listExpr = a.getListExpr();
      return name + listExpr + ")";
    } else if (action instanceof UnmarkAllAction) {
      UnmarkAllAction a = (UnmarkAllAction) action;
      String verbalize = verbalizer.verbalize(a.getType());
      String but = a.getList() == null ? "" : ", " + verbalizer.verbalize(a.getList());
      return name + verbalize + but + ")";
    }

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

    a = new GetFeatureAction(stringExpr, var);
    s = v.verbalize(a);
    assertEquals("GETFEATURE(\"string\", anyVar)", s);

    // GETLIST
    a = new GetListAction(var, stringExpr);
    s = v.verbalize(a);
    assertEquals("GETLIST(anyVar, \"string\")", s);

    // LOG
    a = new LogAction(stringExpr, Level.INFO);
View Full Code Here

      String pa = verbalizer.verbalize(active);
      String pp = panelty == null ? "" : ", " + verbalizer.verbalize(panelty);
      String pf = factor == null ? "" : ", " + verbalizer.verbalize(factor);
      return name + pa + pp + pf + ")";
    } else if (action instanceof GetListAction) {
      GetListAction a = (GetListAction) action;
      String var = a.getVar();
      String op = verbalizer.verbalize(a.getOpExpr());
      return name + var + ", " + op + ")";
    } else if (action instanceof MarkTableAction) {
      MarkTableAction a = (MarkTableAction) action;
      TypeExpression typeExpr = a.getTypeExpr();
      NumberExpression indexExpr = a.getIndexExpr();
      WordTableExpression tableExpr = a.getTableExpr();
      Map<StringExpression, NumberExpression> featureMap = a.getFeatureMap();
      BooleanExpression ignoreCase = a.getIgnoreCase();
      NumberExpression ignoreLength = a.getIgnoreLength();
      StringExpression ignoreChar = a.getIgnoreChar();
      NumberExpression maxIgnoreChar = a.getMaxIgnoreChar();

      String type = verbalizer.verbalize(typeExpr);
      String index = verbalizer.verbalize(indexExpr);
      String table = verbalizer.verbalize(tableExpr);
      String map = "";
      if (featureMap != null) {
        map += ", ";
        for (StringExpression each : featureMap.keySet()) {
          map += verbalizer.verbalize(each);
          map += " = ";
          map += verbalizer.verbalize(featureMap.get(each));
          map += ", ";
        }
      }
      String icase = ignoreCase == null ? "" : ", " + verbalizer.verbalize(ignoreCase);
      String ilength = ignoreCase == null ? "" : ", " + verbalizer.verbalize(ignoreLength);
      String ichar = ignoreCase == null ? "" : ", " + verbalizer.verbalize(ignoreChar);
      String mic = ignoreCase == null ? "" : ", " + verbalizer.verbalize(maxIgnoreChar);

      return name + type + ", " + index + ", " + table + map + icase + ilength + ichar + mic + ")";
    } else if (action instanceof MatchedTextAction) {
      MatchedTextAction a = (MatchedTextAction) action;
      String var = a.getVar();
      List<NumberExpression> list = a.getList();
      String indexes = list == null ? "" : ", " + verbalizer.verbalizeExpressionList(list);
      return name + var + indexes + ")";
    } else if (action instanceof RemoveDuplicateAction) {
      RemoveDuplicateAction a = (RemoveDuplicateAction) action;
      String listExpr = a.getListExpr();
      return name + listExpr + ")";
    } else if (action instanceof UnmarkAllAction) {
      UnmarkAllAction a = (UnmarkAllAction) action;
      String verbalize = verbalizer.verbalize(a.getType());
      String but = a.getList() == null ? "" : ", " + verbalizer.verbalize(a.getList());
      return name + verbalize + but + ")";
    } else if (action instanceof TrimAction) {
      TrimAction a = (TrimAction) action;
      TypeListExpression typeList = a.getTypeList();
      String verbalize = "";
      if(typeList != null) {
        verbalize = verbalizer.verbalize(typeList);
      } else if(a.getTypes() != null) {
        verbalize = verbalizer.verbalizeExpressionList(a.getTypes());
      }
      return name + verbalize + ")";
    } else if (action instanceof ImplicitMarkAction) {
      ImplicitMarkAction a = (ImplicitMarkAction) action;
      return verbalizer.verbalize(a.getType());
    } else if (action instanceof ImplicitFeatureAction) {
      ImplicitFeatureAction a = (ImplicitFeatureAction) action;
      return verbalizer.verbalize(a.getExpr());
    }

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

    a = new GetFeatureAction(stringExpr, var);
    s = v.verbalize(a);
    assertEquals("GETFEATURE(\"string\", anyVar)", s);

    // GETLIST
    a = new GetListAction(var, stringExpr);
    s = v.verbalize(a);
    assertEquals("GETLIST(anyVar, \"string\")", s);

    // LOG
    a = new LogAction(stringExpr, Level.INFO);
View Full Code Here

TOP

Related Classes of org.apache.uima.ruta.action.GetListAction

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.