Class SplitSource<E extends GraphBasedNonterminal>

java.lang.Object
de.saar.chorus.domgraph.chart.SplitSource<E>
Direct Known Subclasses:
CompleteSplitSource, OneSplitSource

public abstract class SplitSource<E extends GraphBasedNonterminal> extends Object
An abstract superclass for classes that compute splits. A ChartSolver relies on an object of a subclass of this class to provide the splits for a subgraph. You can provide your own subclass by implementing the computeSplits method of this class.
Author:
Alexander Koller
  • Field Details

  • Constructor Details

    • SplitSource

      public SplitSource(DomGraph graph)
  • Method Details

    • makeToplevelSubgraph

      public abstract E makeToplevelSubgraph(Set<String> graph)
    • computeSplits

      public abstract Iterator<Split<E>> computeSplits(E subgraph) throws UnsolvableSubgraphException
      Implement this abstract method when you write your own subclass of SplitSource. The method gets a subgraph as its argument, and has the task of computing an iterator over the splits of this subgraph.

      Parameters:
      subgraph - a subgraph
      Returns:
      an iterator over some or all splits of this subgraph
      Throws:
      UnsolvableSubgraphException
    • reduceIfNecessary

      public abstract void reduceIfNecessary(ConcreteRegularTreeGrammar<E> chart)
      Reduces the computed RTG. If your split source is such that the RTG it computes is not automatically reduced, you should implement this method to call reduce() on the output RTG. This method is called as the last operation by the chart solver.
      Parameters:
      chart - the output RTG computed by the chart solver
    • computePotentialFreeRoots

      protected List<String> computePotentialFreeRoots(E subgraph)
      Computes the list of all nodes in the subgraphs which have no incoming edges. These nodes are candidates for being free roots; however, you still need to check that the holes are in different biconnected components.
      Parameters:
      subgraph - a subgraph
      Returns:
      the list of nodes without in-edges in the subgraph
    • getGraph

      public DomGraph getGraph()