Package org.nineml.coffeegrinder.parser
Class EarleyChart
java.lang.Object
org.nineml.coffeegrinder.parser.EarleyChart
The chart used for Earley parsing.
-
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(int row, EarleyItem item) Determine if an item is in the chart.get(int row) Get a row from the chart.intsize()How big is the chart?
-
Method Details
-
size
public int size()How big is the chart?- Returns:
- the number of rows in the chart.
-
get
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
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
-