|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umn.cs.nlp.old.ChartCell
public class ChartCell
Parse chart cell for a Chiang-style CKY+ parser
Constructor Summary | |
---|---|
ChartCell(int X_node_b,
double X_node_beta,
int S_node_b,
double S_node_beta,
LanguageModel languageModel)
Construct a new ChartCell; use the specified parameters for pruning. |
Method Summary | |
---|---|
boolean |
add(int i,
int j,
TranslationRule rule)
Attempt to store a new terminal parse span in this chart cell. |
boolean |
add(int i,
int j,
TranslationRule rule,
ParseSpan... children)
Attempt to store a new parse span in this chart cell. |
void |
addTerminal(int i,
String token)
Set the specified token to be the terminal token for this chart cell |
Iterable<ParseSpan> |
getNBest(int n)
|
boolean |
isEmpty()
Is this chart cell empty? |
Iterator<ParseSpan> |
iterator()
|
int |
size()
Get the total number of parse spans stored in this chart cell. |
int |
ssize()
Get the number of S parse spans stored in this chart cell. |
int |
xsize()
Get the number of X parse spans stored in this chart cell. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChartCell(int X_node_b, double X_node_beta, int S_node_b, double S_node_beta, LanguageModel languageModel)
X_node_b
- X_node_beta
- S_node_b
- S_node_beta
- Method Detail |
---|
public int xsize()
public int ssize()
public int size()
public boolean isEmpty()
true
if there are no ParseSpan
objects stored in this chart cell; false
otherwisepublic void addTerminal(int i, String token)
i
- the start index in the chart for this tokentoken
- the token to store as a terminal parse spanpublic boolean add(int i, int j, TranslationRule rule)
If appropriate, this method will also attempt to add a new parse span for the rule S => X to this chart cell.
If the rule to be added has a left-hand side of "X",
and the rule is successfully added as a new parse span,
but the corresponding S => X rule is not sucessfully added,
this method will still return true
.
true
if a new parse span was successfully added to the chart cell,
false
otherwisepublic boolean add(int i, int j, TranslationRule rule, ParseSpan... children)
If appropriate, this method will also attempt to add a new parse span for the rule S => X to this chart cell.
If the rule to be added has a left-hand side of "X",
and the rule is successfully added as a new parse span,
but the corresponding S => X rule is not sucessfully added,
this method will still return true
.
true
if a new parse span was successfully added to the chart cell,
false
otherwisepublic Iterable<ParseSpan> getNBest(int n)
public Iterator<ParseSpan> iterator()
iterator
in interface Iterable<ParseSpan>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |