Examples of ColumnDescription


Examples of org.maltparserx.core.io.dataformat.ColumnDescription

      DependencyNode node = outputGraph.addDependencyNode(i+1);
      String[] items = tokens[i].split("\t");
      Edge edge = null;
      for (int j = 0; j < items.length; j++) {
        if (columns.hasNext()) {
          ColumnDescription column = columns.next();
          if (column.getCategory() == ColumnDescription.INPUT && node != null) {
            outputGraph.addLabel(node, column.getName(), items[j]);
          } else if (column.getCategory() == ColumnDescription.HEAD) {
            if (column.getCategory() != ColumnDescription.IGNORE && !items[j].equals("_")) {
              edge = ((DependencyStructure)outputGraph).addDependencyEdge(Integer.parseInt(items[j]), i+1);
            }
          } else if (column.getCategory() == ColumnDescription.DEPENDENCY_EDGE_LABEL && edge != null) {
            outputGraph.addLabel(edge, column.getName(), items[j]);
          }
        }
      }
    }
    outputGraph.setDefaultRootEdgeLabel(outputGraph.getSymbolTables().getSymbolTable("DEPREL"), "ROOT");
View Full Code Here

Examples of org.maltparserx.core.io.dataformat.ColumnDescription

   * @param spec a propagation specification
   * @param dataFormatInstance a data format instance
   * @throws MaltChainedException
   */
  public Propagation(PropagationSpec spec, DataFormatInstance dataFormatInstance) throws MaltChainedException {
    ColumnDescription fromColumn = dataFormatInstance.getColumnDescriptionByName(spec.getFrom());
    if (fromColumn == null) {
      throw new PropagationException("The symbol table '"+spec.getFrom()+" does not exists.");
    }
    fromTable = fromColumn.getSymbolTable();

    ColumnDescription toColumn = dataFormatInstance.getColumnDescriptionByName(spec.getTo());
    if (toColumn == null) {
      toColumn = dataFormatInstance.addInternalColumnDescription(spec.getTo(), fromColumn);
      toTable = toColumn.getSymbolTable();
    }

   
    forSet = new TreeSet<String>();
    if (spec.getFor() != null && spec.getFor().length() > 0) {
      String[] items = spec.getFor().split("\\|");
     
      for (String item : items) {
        forSet.add(item);
      }
    }
   
    overSet = new TreeSet<String>();
    if (spec.getOver() != null && spec.getOver().length() > 0) {
      String[] items = spec.getOver().split("\\|");
     
      for (String item : items) {
        overSet.add(item);
      }
    }
   
    ColumnDescription deprelColumn = dataFormatInstance.getColumnDescriptionByName("DEPREL");
    deprelTable = deprelColumn.getSymbolTable();
    symbolSeparator = Pattern.compile("\\|");
  }
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.