Class Chart

java.lang.Object
  extended byChart

public class Chart
extends java.lang.Object

The basic data structure for a chart parser, constisting of a set of entries (completed constituents) and a set of active arcs (representing partially-completed constituents corresponding to grammar rules).


Field Summary
(package private)  java.util.List[] arcs
          Active arcs indexed by word position (ie., each position contains a list of all the active arcs ENDING at that position).
(package private)  java.util.List[] entries
          Entries (completed constituents) indexed by word position (ie., each position contains a list of all the constituents starting at that position).
 
Constructor Summary
Chart(int length)
          Create a new Chart of the given length.
 
Method Summary
 void add(Arc arc)
          Adds given Arc (active arc) to this Chart, indexed by ending index.
 void add(Entry entry)
          Adds given Entry (completed constituent) to this Chart, indexed by starting position.
 java.util.List getArcsEndingAtPosition(int end)
          Returns the list of Arcs that end at the given position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entries

java.util.List[] entries
Entries (completed constituents) indexed by word position (ie., each position contains a list of all the constituents starting at that position).


arcs

java.util.List[] arcs
Active arcs indexed by word position (ie., each position contains a list of all the active arcs ENDING at that position).

Constructor Detail

Chart

public Chart(int length)
Create a new Chart of the given length.

Method Detail

add

public void add(Entry entry)
Adds given Entry (completed constituent) to this Chart, indexed by starting position.


add

public void add(Arc arc)
Adds given Arc (active arc) to this Chart, indexed by ending index.


getArcsEndingAtPosition

public java.util.List getArcsEndingAtPosition(int end)
Returns the list of Arcs that end at the given position.