Package org.apache.uima.flow

Examples of org.apache.uima.flow.SimpleStepWithResultSpec


        ResultSpecification neededResultSpec = node.getResultSpec();     
        ResultSpecification previousResultSpec = lastResultSpecForComponent.get(component);
       
        if (null == previousResultSpec || previousResultSpec != neededResultSpec) {
          lastResultSpecForComponent.put(component, neededResultSpec);
          return new SimpleStepWithResultSpec(component, neededResultSpec);
        }
        // null is a special flag saying the previous component result spec is still good
        return new SimpleStepWithResultSpec(node.getCasProcessorKey(), null);
//        return new SimpleStepWithResultSpec(component, neededResultSpec); // for testing with caching disabled
      }
//    }
    return new FinalStep();
  }
View Full Code Here


        ResultSpecification neededResultSpec = node.getResultSpec();     
        ResultSpecification previousResultSpec = lastResultSpecForComponent.get(component);
       
        if (null == previousResultSpec || previousResultSpec != neededResultSpec) {
          lastResultSpecForComponent.put(component, neededResultSpec);
          return new SimpleStepWithResultSpec(component, neededResultSpec);
        }
        // null is a special flag saying the previous component result spec is still good
        return new SimpleStepWithResultSpec(node.getCasProcessorKey(), null);
//        return new SimpleStepWithResultSpec(component, neededResultSpec); // for testing with caching disabled
      }
//    }
    return new FinalStep();
  }
View Full Code Here

        if (shouldEngineBeCalled == true) {
          // set result spec for current analysis engine
          node.setResultSpec(currentAnalysisResultSpec);

          // return current analysis engine node
          return new SimpleStepWithResultSpec(node.getCasProcessorKey(), currentAnalysisResultSpec);
        } else // no engine left which can be called
        {
          return new FinalStep();
        }
      }
    } else if (mFlowTable != null) {
      AnalysisSequenceCapabilityNode node = null;

      // check if document language is included in the flowTable
      List flow = (List) mFlowTable.get(documentLanguage);

      if (flow == null) // try to get flow without language extension or with x-unspecified
      {
        // strip language extension if available
        int index = documentLanguage.indexOf(LANGUAGE_SEPARATOR);

        // if country extension is available
        if (index >= 0) {
          // check if document language is included in the flowTable
          flow = (List) mFlowTable.get(documentLanguage.substring(0, index));
          // If the language was not found, use flow for unspecified lang instead.
          if (flow == null) {
            flow = (List) mFlowTable.get(UNSPECIFIED_LANGUAGE);
          }
        } else // try to get flow for language x-unspecified
        {
          flow = (List) mFlowTable.get(UNSPECIFIED_LANGUAGE);
        }
      }

      // if flow is available get next node
      if (flow != null) {
        if (flow.size() > mIndex) {
          node = (AnalysisSequenceCapabilityNode) flow.get(mIndex++);
          while (node == null && flow.size() > mIndex) {
            node = (AnalysisSequenceCapabilityNode) flow.get(mIndex++);
          }
        }
      }
      if (node != null) {
        return new SimpleStepWithResultSpec(node.getCasProcessorKey(), node.getResultSpec());
      }
    }
    return new FinalStep();
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.flow.SimpleStepWithResultSpec

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.