Class EarleyChart


  • public class EarleyChart
    extends java.lang.Object
    The chart used for Earley parsing.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(int row, EarleyItem item)
      Determine if an item is in the chart.
      java.util.List<EarleyItem> get​(int row)
      Get a row from the chart.
      int size()
      How big is the chart?
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • size

        public int size()
        How big is the chart?
        Returns:
        the number of rows in the chart.
      • get

        public java.util.List<EarleyItem> get​(int row)
        Get a row from the chart.

        The chart will be enlarged if necessary.

        Parameters:
        row - the row number (0-indexed).
        Returns:
        the contents of the row.
      • contains

        public boolean contains​(int row,
                                EarleyItem item)
        Determine if an item is in the chart.

        This method will be faster than a linear search of the row.

        Parameters:
        row - the row to search
        item - the item to search form
        Returns:
        true if the row contains the item