|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umn.cs.nlp.parser.ChartCell
public class ChartCell
Represents a completed span in a variant CKY+ parse chart. Rules are not required to be in Chomsky Normal Form.
Constructor Summary | |
---|---|
ChartCell(int i,
int j,
BasicRuleLHS lhs,
ChartCell... children)
Construct a new chart cell that spans from i to j. |
|
ChartCell(int i,
String terminal)
Construct a new chart cell that contains a terminal symbol. |
Method Summary | |
---|---|
int |
compareTo(ChartCell c)
|
boolean |
equals(ChartCell c)
|
ChartCell |
getChild(int index)
Get the nth child cell pointed to by this cell. |
String |
getItem()
Get the item stored in this chart cell. |
double |
getLogProb()
Get the log probability associated with this cell |
ChartCell |
getOnlyChild()
Get the first child cell pointed to by this cell. |
int |
getSpansFrom()
Get the chart index from which this cell spans |
int |
getSpansTo()
Get the chart index to which this cell spans |
int |
getSplitPoint(int index)
Get the nth split point for this chart cell. |
int |
hashCode()
|
boolean |
hasNoChildren()
Returns true if this cell has no children, false otherwise |
int |
numberOfChildren()
Get the number of children of this cell |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChartCell(int i, String terminal)
i
- start index from which this cell spansterminal
- item which this cell containspublic ChartCell(int i, int j, BasicRuleLHS lhs, ChartCell... children)
i
- start index from which this cell spansj
- end index to which this cell spanslhs
- item which this cell containschildren
- the cells pointed to by this cellMethod Detail |
---|
public String getItem()
public ChartCell getOnlyChild()
Note: this method is is intended for use with unary rule cells and terminal cells, but if called on a cell with more than one child, will return the same value as if getChild(0) had been called.
public ChartCell getChild(int index)
index
- index of the child cell to be returned
public boolean hasNoChildren()
true
if this cell has no children, false
otherwise
true
if this cell has no children, false
otherwisepublic int numberOfChildren()
public double getLogProb()
public int getSpansFrom()
public int getSpansTo()
public int getSplitPoint(int index)
IllegalArgumentException
- if index is greater than the number of split points for this cellpublic boolean equals(ChartCell c)
equals
in interface Equatable<ChartCell>
public int hashCode()
hashCode
in class Object
public int compareTo(ChartCell c)
compareTo
in interface Comparable<ChartCell>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |