Package org.apache.uima.ruta

Examples of org.apache.uima.ruta.ScriptApply


          RutaStream window = stream.getWindowStream(each, eachType);
          for (RutaStatement element : getElements()) {
            if (stop)
              break;
            if (element != null) {
              ScriptApply elementApply = element.apply(window, crowd);
              if (elementApply instanceof BlockApply) {
                BlockApply ba = (BlockApply) elementApply;
                if (ba.getRuleApply().getApplied() > 0) {
                  stop = true;
                }
View Full Code Here


//    blockApply.setRuleApply(dummyRuleApply);
//    ruleMatch.addDelegateApply(this, blockApply);
    for (AnnotationFS annotationFS : matchedAnnotationsOf) {
      RutaStream windowStream = stream.getWindowStream(annotationFS, annotationFS.getType());
      for (RutaStatement each : inlinedRules) {
        ScriptApply apply = each.apply(windowStream, crowd);
//        blockApply.add(apply);
        ruleMatch.addDelegateApply(this, apply);
        result.add(apply);
      }
    }
View Full Code Here

          RutaStream window = stream.getWindowStream(each, eachType);
          for (RutaStatement element : getElements()) {
            if (stop)
              break;
            if (element != null) {
              ScriptApply elementApply = element.apply(window, crowd);
              if (elementApply instanceof BlockApply) {
                BlockApply ba = (BlockApply) elementApply;
                if (ba.getRuleApply().getApplied() > 0) {
                  stop = true;
                }
View Full Code Here

  @Override
  public ScriptApply apply(RutaStream stream, InferenceCrowd crowd) {
    boolean oldSetting = stream.isOnlyOnce();
    stream.setOnlyOnce(true);
    ScriptApply result = super.apply(stream, crowd);
    stream.setOnlyOnce(oldSetting);
    return result;
  }
View Full Code Here

      stack.push(result);
      applies.put(stmt, stack);
      if (parent != null) {
        Stack<ScriptApply> parentStack = applies.get(parent);
        if (parentStack != null && !parentStack.isEmpty()) {
          ScriptApply parentApply = parentStack.peek();
          if (parentApply instanceof BlockApply) {
            BlockApply blockApply = (BlockApply) parentApply;
            if (element instanceof RutaRule && parent.getRule().equals(element)
                    && result instanceof RuleApply) {
              blockApply.setRuleApply((RuleApply) result);
View Full Code Here

    }
    List<AnnotationFS> matchedAnnotationsOf = match.getMatchedAnnotationsOf(element);
    for (AnnotationFS annotationFS : matchedAnnotationsOf) {
      RutaStream windowStream = stream.getWindowStream(annotationFS,
              stream.getDocumentAnnotationType());
      ScriptApply apply = block.apply(windowStream, crowd);
      match.addDelegateApply(this, apply);
    }

  }
View Full Code Here

          RutaStream stream, InferenceCrowd crowd, RutaModule targetScript) {
    RutaBlock block = targetScript.getBlock(blockName);
    if (block == null) {
      return;
    }
    ScriptApply apply = block.apply(stream, crowd);
    match.addDelegateApply(this, apply);
  }
View Full Code Here

      stack.push(result);
      applies.put(stmt, stack);
      if (parent != null) {
        Stack<ScriptApply> parentStack = applies.get(parent);
        if (parentStack != null && !parentStack.isEmpty()) {
          ScriptApply parentApply = parentStack.peek();
          if (parentApply instanceof BlockApply) {
            BlockApply blockApply = (BlockApply) parentApply;
            if (element instanceof RutaRule && parent.getRule().equals(element)
                    && result instanceof RuleApply) {
              blockApply.setRuleApply((RuleApply) result);
View Full Code Here

    }
    List<AnnotationFS> matchedAnnotationsOf = match.getMatchedAnnotationsOf(element, stream);
    for (AnnotationFS annotationFS : matchedAnnotationsOf) {
      RutaStream windowStream = stream.getWindowStream(annotationFS,
              stream.getDocumentAnnotationType());
      ScriptApply apply = block.apply(windowStream, crowd);
      match.addDelegateApply(this, apply);
    }

  }
View Full Code Here

    RutaBlock block = targetScript.getBlock(blockName);
    if (block == null) {
      return;
    }
    RutaStream completeStream = stream.getCompleteStream();
    ScriptApply apply = block.apply(completeStream, crowd);
    match.addDelegateApply(this, apply);
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.ruta.ScriptApply

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.