Package org.maltparserx.parser.guide

Examples of org.maltparserx.parser.guide.GuideException


    } else if (decision.getRelationToNextDecision() == RelationToNextDecision.NONE) {
      decisionModelClass = org.maltparserx.parser.guide.decision.OneDecisionModel.class;
    }

    if (decisionModelClass == null) {
      throw new GuideException("Could not find an appropriate decision model for the relation to the next decision");
    }
   
    try {
      Class<?>[] argTypes = { org.maltparserx.parser.guide.ClassifierGuide.class, org.maltparserx.parser.guide.decision.DecisionModel.class,
            java.lang.String.class };
      Object[] arguments = new Object[3];
      arguments[0] = getGuide();
      arguments[1] = this;
      arguments[2] = branchedDecisionSymbol;
      Constructor<?> constructor = decisionModelClass.getConstructor(argTypes);
      return (DecisionModel)constructor.newInstance(arguments);
    } catch (NoSuchMethodException e) {
      throw new GuideException("The decision model class '"+decisionModelClass.getName()+"' cannot be initialized. ", e);
    } catch (InstantiationException e) {
      throw new GuideException("The decision model class '"+decisionModelClass.getName()+"' cannot be initialized. ", e);
    } catch (IllegalAccessException e) {
      throw new GuideException("The decision model class '"+decisionModelClass.getName()+"' cannot be initialized. ", e);
    } catch (InvocationTargetException e) {
      throw new GuideException("The decision model class '"+decisionModelClass.getName()+"' cannot be initialized. ", e);
    }
  }
View Full Code Here

TOP

Related Classes of org.maltparserx.parser.guide.GuideException

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.