|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.umn.cs.nlp.old.ParseSpan
public class ParseSpan
Represents a completed span in a variant CKY+ parse chart. Rules are not required to be in Chomsky Normal Form.
Field Summary | |
---|---|
static String |
ELIDE_STAR
|
Constructor Summary | |
---|---|
ParseSpan(int i,
int j,
LanguageModel languageModel,
TranslationRule rule,
ParseSpan... children)
Construct a new chart cell that spans from i to j. |
|
ParseSpan(int i,
LanguageModel languageModel,
TranslationRule rule)
|
|
ParseSpan(int i,
String terminal)
Construct a new chart cell that contains a terminal symbol. |
Method Summary | |
---|---|
int |
compareTo(ParseSpan c)
|
boolean |
equals(ParseSpan c)
|
ParseSpan |
getChild(int index)
Get the nth child cell pointed to by this cell. |
String |
getItem()
Get the item stored in this chart cell. |
ParseSpan |
getOnlyChild()
Get the first child cell pointed to by this cell. |
TranslationRule |
getRule()
|
double |
getScore()
Get the log probability associated with 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. |
LoglinearTranslationFeatures |
getWeights()
|
int |
hashCode()
|
boolean |
hasNoChildren()
Returns true if this cell has no children, false otherwise |
boolean |
isTerminal()
|
static void |
main(String[] args)
|
int |
numberOfChildren()
Get the number of children of this cell |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String ELIDE_STAR
Constructor Detail |
---|
public ParseSpan(int i, String terminal)
i
- start index from which this cell spansterminal
- item which this cell containspublic ParseSpan(int i, int j, LanguageModel languageModel, TranslationRule rule, ParseSpan... 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 cellpublic ParseSpan(int i, LanguageModel languageModel, TranslationRule rule)
Method Detail |
---|
public String toString()
toString
in class Object
public static void main(String[] args)
public LoglinearTranslationFeatures getWeights()
public boolean isTerminal()
public String getItem()
public TranslationRule getRule()
public ParseSpan 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 ParseSpan 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 getScore()
getScore
in interface Scorable
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(ParseSpan c)
equals
in interface Equatable<ParseSpan>
public int hashCode()
hashCode
in class Object
public int compareTo(ParseSpan c)
compareTo
in interface Comparable<ParseSpan>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |