Package org.nineml.coffeegrinder.parser
Class EarleyChart
- java.lang.Object
-
- org.nineml.coffeegrinder.parser.EarleyChart
-
public class EarleyChart extends java.lang.ObjectThe chart used for Earley parsing.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(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.intsize()How big is the chart?
-
-
-
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 searchitem- the item to search form- Returns:
- true if the row contains the item
-
-