Package org.maltparserx.parser

Examples of org.maltparserx.parser.ParsingException


    return input.isEmpty() && stack.size() == 1;
  }
 
  public DependencyNode getStackNode(int index) throws MaltChainedException {
    if (index < 0) {
      throw new ParsingException("Stack index must be non-negative in feature specification. ");
    }
    if (stack.size()-index > 0) {
      return stack.get(stack.size()-1-index);
    }
    return null;
View Full Code Here


    return null;
  }
 
  private DependencyNode getBufferNode(int index) throws MaltChainedException {
    if (index < 0) {
      throw new ParsingException("Input index must be non-negative in feature specification. ");
    }
    if (input.size()-index > 0) {
      return input.get(input.size()-1-index);
   
    return null;
View Full Code Here

    this.allowShift = allowShift;
  }

  public DependencyNode getLeftNode(int index) throws MaltChainedException {
    if (index < 0) {
      throw new ParsingException("Left index must be non-negative in feature specification. ");
    }
    if (left-index >= 0) {
      return input.get(left-index);
    }
    return null;
View Full Code Here

    return null;
  }
 
  public DependencyNode getRightNode(int index) throws MaltChainedException {
    if (index < 0) {
      throw new ParsingException("Right index must be non-negative in feature specification. ");
    }
    if (right+index < input.size()) {
      return input.get(right+index);
    }
    return null;
View Full Code Here

    return null;
  }
 
  public DependencyNode getLeftContextNode(int index) throws MaltChainedException {
    if (index < 0) {
      throw new ParsingException("LeftContext index must be non-negative in feature specification. ");
    }
   
    int tmpindex = 0;
    for (int i = left+1; i < right; i++) {
      if (!input.get(i).hasAncestorInside(left, right)) {
View Full Code Here

    return null;
  }
 
  public DependencyNode getRightContextNode(int index) throws MaltChainedException {
    if (index < 0) {
      throw new ParsingException("RightContext index must be non-negative in feature specification. ");
    }
    int tmpindex = 0;
    for (int i = right-1; i > left; i--) {
      if (!input.get(i).hasAncestorInside(left, right)) {
        if (tmpindex == index) {
View Full Code Here

    setAlgorithm(parsingAlgorithm);
  }
 
  public void initialize(Object[] arguments) throws MaltChainedException {
    if (arguments.length != 1) {
      throw new ParsingException("Could not initialize "+this.getClass().getName()+": number of arguments are not correct. ");
    }
    if (!(arguments[0] instanceof Integer)) {
      throw new ParsingException("Could not initialize "+this.getClass().getName()+": the first argument is not an integer. ");
    }
   
    setIndex(((Integer)arguments[0]).intValue());
  }
View Full Code Here

    return input.isEmpty();
  }
 
  public DependencyNode getStackNode(int index) throws MaltChainedException {
    if (index < 0) {
      throw new ParsingException("Stack index must be non-negative in feature specification. ");
    }
    if (stack.size()-index > 0) {
      return stack.get(stack.size()-1-index);
    }
    return null;
View Full Code Here

    return null;
  }
 
  public DependencyNode getInputNode(int index) throws MaltChainedException {
    if (index < 0) {
      throw new ParsingException("Input index must be non-negative in feature specification. ");
    }
    if (input.size()-index > 0) {
      return input.get(input.size()-1-index);
   
    return null;
View Full Code Here

    setAlgorithm(parsingAlgorithm);
  }
 
  public void initialize(Object[] arguments) throws MaltChainedException {
    if (arguments.length != 1) {
      throw new ParsingException("Could not initialize "+this.getClass().getName()+": number of arguments are not correct. ");
    }
    if (!(arguments[0] instanceof Integer)) {
      throw new ParsingException("Could not initialize "+this.getClass().getName()+": the first argument is not an integer. ");
    }
   
    setIndex(((Integer)arguments[0]).intValue());
  }
View Full Code Here

TOP

Related Classes of org.maltparserx.parser.ParsingException

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.