Examples of MaltChainedException


Examples of org.maltparserx.core.exception.MaltChainedException

      switch(argv[i-1].charAt(1)) {
      case 's':
        try {
          START_ID_OF_NONTERMINALS = Integer.parseInt(argv[i]);
        } catch (NumberFormatException e){
          throw new MaltChainedException("The TigerXML Reader option -s must be an integer value. ");
        }
        break;
      default:
        throw new DataFormatException("Unknown svm parameter: '"+argv[i-1]+"' with value '"+argv[i]+"'. ");   
      }
View Full Code Here

Examples of org.maltparserx.core.exception.MaltChainedException

   * @param commandLine a commandLine string that controls the MaltParser
   * @throws MaltChainedException
   */
  public void initializeParserModel(String commandLine) throws MaltChainedException {
    if (optionContainer == -1) {
      throw new MaltChainedException("MaltParserService has been initialized as an option free initialization and therefore no parser model can be initialized.");
    }
    OptionManager.instance().parseCommandLine(commandLine, optionContainer);
    // Creates an engine
    engine = new Engine();
    // Initialize the engine with option container and gets a flow chart instance
View Full Code Here

Examples of org.maltparserx.core.exception.MaltChainedException

   * @return a dependency structure
   * @throws MaltChainedException
   */
  public DependencyStructure parse(String[] tokens) throws MaltChainedException {
    if (!initialized) {
      throw new MaltChainedException("No parser model has been initialized. Please use the method initializeParserModel() before invoking this method.");
    }
    if (tokens == null || tokens.length == 0) {
      throw new MaltChainedException("Nothing to parse. ");
    }

    DependencyStructure outputGraph = new DependencyGraph(singleMalt.getSymbolTables());
   
    for (int i = 0; i < tokens.length; i++) {
View Full Code Here

Examples of org.maltparserx.core.exception.MaltChainedException

   * @return a dependency structure
   * @throws MaltChainedException
   */
  public DependencyStructure toDependencyStructure(String[] tokens) throws MaltChainedException {
    if (!initialized) {
      throw new MaltChainedException("No parser model has been initialized. Please use the method initializeParserModel() before invoking this method.");
    }
    if (tokens == null || tokens.length == 0) {
      throw new MaltChainedException("Nothing to convert. ");
    }
    DependencyStructure outputGraph = new DependencyGraph(singleMalt.getSymbolTables());
   
    for (int i = 0; i < tokens.length; i++) {
      Iterator<ColumnDescription> columns = dataFormatInstance.iterator();
View Full Code Here

Examples of org.maltparserx.core.exception.MaltChainedException

    // Initialize data format instance
    DataFormatInstance dataFormatInstance = dataFormatSpecification.createDataFormatInstance(symbolTables, "none");

    // Creates a dependency graph
    if (tokens == null || tokens.length == 0) {
      throw new MaltChainedException("Nothing to convert. ");
    }
    DependencyStructure outputGraph = new DependencyGraph(symbolTables);
   
    for (int i = 0; i < tokens.length; i++) {
      Iterator<ColumnDescription> columns = dataFormatInstance.iterator();
View Full Code Here

Examples of org.maltparserx.core.exception.MaltChainedException

   *
   * @throws MaltChainedException
   */
  public void terminateParserModel() throws MaltChainedException {
    if (!initialized) {
      throw new MaltChainedException("No parser model has been initialized. Please use the method initializeParserModel() before invoking this method.");
    }
    // Runs the postprocess chart items of the "parse" flow chart
    if (flowChartInstance.hasPostProcessChartItems()) {
      flowChartInstance.postprocess();
    }
View Full Code Here

Examples of org.maltparserx.core.exception.MaltChainedException

      headSpine = ((PhraseStructureNode)depEdge.getSource()).getParent();
      if (depEdge.hasLabel(graph.getSymbolTables().getSymbolTable(ATTACH))) {
        try {
        a = Integer.parseInt((depEdge.getLabelSymbol(graph.getSymbolTables().getSymbolTable(ATTACH))));
        } catch (NumberFormatException e) {
          throw new MaltChainedException(e.getMessage());
        }
      }
      for (int i = 0; i < a && headSpine != null; i++) {
        headSpine = headSpine.getParent();
      }
View Full Code Here

Examples of org.maltparserx.core.exception.MaltChainedException

        }
          bos.flush();
          bos.close();
          bis.close();
    } catch (FileNotFoundException e) {
      throw new MaltChainedException("The destination file '"+destination+"' cannot be created when coping the file. ", e);
    } catch (IOException e) {
      throw new MaltChainedException("The source file '"+source+"' cannot be copied to destination '"+destination+"'. ", e);
    }
  }
View Full Code Here

Examples of org.maltparserx.core.exception.MaltChainedException

    return root;
  }
 
  public Edge addPhraseStructureEdge(PhraseStructureNode parent, PhraseStructureNode child) throws MaltChainedException {
    if (parent == null || child == null) {
      throw new MaltChainedException("Parent or child node is missing.");
    } else if (parent instanceof NonTerminalNode && !child.isRoot()) {
      Edge e = edgePool.checkOut();
      e.setBelongsToGraph(this);
      e.setEdge((Node)parent, (Node)child, Edge.PHRASE_STRUCTURE_EDGE);
      graphEdges.add(e);
      return e;
    } else {
      throw new MaltChainedException("Parent or child node is not of correct node type.");
    }
  }
View Full Code Here

Examples of org.maltparserx.core.exception.MaltChainedException

    }
  }
 
  public void removePhraseStructureEdge(PhraseStructureNode parent, PhraseStructureNode child) throws MaltChainedException {
    if (parent == null || child == null) {
      throw new MaltChainedException("Parent or child node is missing.");
    } else if (parent instanceof NonTerminalNode && !child.isRoot()) {
      for (Edge e : graphEdges) {
        if (e.getSource() == parent && e.getTarget() == child) {
          e.clear();
          graphEdges.remove(e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.