Package org.maltparserx.parser.history.action

Examples of org.maltparserx.parser.history.action.SingleDecision


  public void addInstance(GuideDecision decision) throws MaltChainedException {
    if (decision instanceof SingleDecision) {
      throw new GuideException("A branched decision model expect more than one decisions. ");
    }
    featureModel.update();
    final SingleDecision singleDecision = ((MultipleDecision)decision).getSingleDecision(decisionIndex);
    if (instanceModel == null) {
      initInstanceModel(singleDecision.getTableContainer().getTableContainerName());
    }
   
    instanceModel.addInstance(singleDecision);
    if (decisionIndex+1 < decision.numberOfDecisions()) {
      if (singleDecision.continueWithNextDecision()) {
        if (children == null) {
          children = new HashMap<Integer,DecisionModel>();
        }
        DecisionModel child = children.get(singleDecision.getDecisionCode());
        if (child == null) {
          child = initChildDecisionModel(((MultipleDecision)decision).getSingleDecision(decisionIndex+1),
              branchedDecisionSymbols+(branchedDecisionSymbols.length() == 0?"":"_")+singleDecision.getDecisionSymbol());
          children.put(singleDecision.getDecisionCode(), child);
        }
        child.addInstance(decision);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.maltparserx.parser.history.action.SingleDecision

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.