Package org.maltparserx.core.syntaxgraph.edge

Examples of org.maltparserx.core.syntaxgraph.edge.Edge


    if (syntaxGraph == null || dataFormatInstance == null) {
      return false;
    }
   
    Element node = null;
    Edge edge = null;
    input.setLength(0);
    int i = 0;
    int terminalCounter = 0;
    int nNewLines = 0;
    syntaxGraph.clear();
View Full Code Here


 
  public void apply(GuideUserAction currentAction, ParserConfiguration config) throws MaltChainedException {
    CovingtonConfig covingtonConfig = (CovingtonConfig)config;
    currentAction.getAction(actionContainers);
   
    Edge e = null;
    switch (transActionContainer.getActionCode()) {
    case LEFTARC:
      e = covingtonConfig.getDependencyGraph().addDependencyEdge(covingtonConfig.getRightTarget().getIndex(), covingtonConfig.getLeftTarget().getIndex());
      addEdgeLabels(e);
      break;
View Full Code Here

      for (SymbolTable table : gnode.getLabelTypes()) {
        pnode.addLabel(table, gnode.getLabelSymbol(table));
      }
     
      if (gnode.hasHead()) {
        final Edge s = gnode.getHeadEdge();
        final Edge t = dependencyGraph.addDependencyEdge(s.getSource().getIndex(), s.getTarget().getIndex());
       
        for (SymbolTable table : s.getLabelTypes()) {
          t.addLabel(table, s.getLabelSymbol(table));
        }
      }
    }
    for (SymbolTable table : source.getDefaultRootEdgeLabels().keySet()) {
      dependencyGraph.setDefaultRootEdgeLabel(table, source.getDefaultRootEdgeLabelSymbol(table));
View Full Code Here

  public void apply(GuideUserAction currentAction, ParserConfiguration configuration) throws MaltChainedException {
    final StackConfig config = (StackConfig)configuration;
    final Stack<DependencyNode> stack = config.getStack();
    final Stack<DependencyNode> input = config.getInput();
    currentAction.getAction(actionContainers);
    Edge e = null;
    DependencyNode head = null;
    DependencyNode dep = null;
    switch (transActionContainer.getActionCode()) {
    case LEFTARC:
      head = stack.pop();
View Full Code Here

      for (SymbolTable table : gnode.getLabelTypes()) {
        pnode.addLabel(table, gnode.getLabelSymbol(table));
      }
     
      if (gnode.hasHead()) {
        Edge s = gnode.getHeadEdge();
        Edge t = dependencyGraph.addDependencyEdge(s.getSource().getIndex(), s.getTarget().getIndex());
       
        for (SymbolTable table : s.getLabelTypes()) {
          t.addLabel(table, s.getLabelSymbol(table));
        }
      }
    }
    for (SymbolTable table : source.getDefaultRootEdgeLabels().keySet()) {
      dependencyGraph.setDefaultRootEdgeLabel(table, source.getDefaultRootEdgeLabelSymbol(table));
View Full Code Here

      for (SymbolTable table : gnode.getLabelTypes()) {
        pnode.addLabel(table, gnode.getLabelSymbol(table));
      }
     
      if (gnode.hasHead()) {
        Edge s = gnode.getHeadEdge();
        Edge t = dependencyGraph.addDependencyEdge(s.getSource().getIndex(), s.getTarget().getIndex());
       
        for (SymbolTable table : s.getLabelTypes()) {
          t.addLabel(table, s.getLabelSymbol(table));
        }
      }
    }
  }
View Full Code Here

  public void apply(GuideUserAction currentAction, ParserConfiguration config) throws MaltChainedException {
    PlanarConfig planarConfig = (PlanarConfig)config;
    Stack<DependencyNode> stack = planarConfig.getStack();
    Stack<DependencyNode> input = planarConfig.getInput();
    currentAction.getAction(actionContainers);
    Edge e = null;
    switch (transActionContainer.getActionCode()) {
    case LEFTARC:
      e = planarConfig.getDependencyStructure().addDependencyEdge(input.peek().getIndex(), stack.peek().getIndex());
      addEdgeLabels(e);
      break;
View Full Code Here

    crossingsGraph = new IdentityHashMap<Edge,List<Edge>>();
    SortedSet<Edge> edges = dg.getEdges();
    //System.out.println(edges.size());
    //System.out.println(dg.nEdges());
    for (Iterator<Edge> iterator1 = edges.iterator(); iterator1.hasNext();) {
      Edge edge1 = iterator1.next();
      for (Iterator<Edge> iterator2 = edges.iterator(); iterator2.hasNext();) {
        Edge edge2 = iterator2.next();
        if ( edge1.getSource().getIndex() < edge2.getSource().getIndex() && cross(edge1,edge2) )
        {
          //System.out.println("Crossing!");
          List<Edge> crossingEdge1 = crossingsGraph.get(edge1);
          if ( crossingEdge1 == null ) { crossingEdge1 = new LinkedList<Edge>(); crossingsGraph.put(edge1, crossingEdge1); }
          crossingEdge1.add(edge2);
View Full Code Here

      List<Edge> crossingEdges = getCrossingEdges(e);
      if ( crossingEdges != null )
      {
        for (Iterator<Edge> iterator = crossingEdges.iterator(); iterator.hasNext();)
        {
          Edge crossingEdge = iterator.next();
          assert ( requiredPlane == FIRST_PLANE || requiredPlane == SECOND_PLANE );
          int crossingEdgeConstraint = getPlaneConstraint(crossingEdge);
          if ( crossingEdgeConstraint == ANY_PLANE )
          {
            if ( requiredPlane == FIRST_PLANE )
View Full Code Here

        config.getInactiveStack().peek().getIndex() );
  }
 
  private Edge getFirstPendingLinkOnAnyPlane ( TwoPlanarConfig config , DependencyStructure gold ) throws MaltChainedException
  {
    Edge e1 = getFirstPendingLinkOnActivePlane ( config , gold );
    Edge e2 = getFirstPendingLinkOnInactivePlane ( config , gold );
    int left1 = Math.min(e1.getSource().getIndex(), e1.getTarget().getIndex());
    int left2 = Math.min(e2.getSource().getIndex(), e2.getTarget().getIndex());
    if ( left1 > left2 ) return e1;
    else return e2;
  }
View Full Code Here

TOP

Related Classes of org.maltparserx.core.syntaxgraph.edge.Edge

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.