public class KBestList extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected int |
addCandidateIndex |
protected SingleDecision |
decision |
protected int |
k |
protected java.util.ArrayList<Candidate> |
kBestList |
protected int |
topCandidateIndex |
Constructor and Description |
---|
KBestList(java.lang.Integer k,
SingleDecision decision)
Creates a k-best list
|
KBestList(SingleDecision decision)
Creates a unrestricted k-best list
|
Modifier and Type | Method and Description |
---|---|
void |
add(int actionCode)
Adds a candidate to the k-best list
|
void |
add(java.lang.String symbol)
Adds a candidate to the k-best list
|
void |
addList(int[] predictionList) |
protected int |
getAddCandidateIndex() |
ScoredCandidate |
getCandidate(int i) |
int |
getCurrentSize()
Returns the current size of the k-best list
|
SingleDecision |
getDecision()
Returns a single decision object
|
int |
getK()
Returns the maximum number of candidates in the k-best list.
|
int |
getKBestListSize() |
protected int |
getTopCandidateIndex() |
protected void |
initKBestList() |
int |
peekNextKBest() |
void |
reset()
Resets the k-best list
|
protected void |
setK(int k)
Sets the maximum number of candidates in the k-best list
|
java.lang.String |
toString() |
boolean |
updateActionWithNextKBest()
Updates the corresponding single decision with the next value in the k-best list.
|
protected int k
protected int topCandidateIndex
protected int addCandidateIndex
protected final SingleDecision decision
public KBestList(SingleDecision decision)
decision
- a reference to the single decision that uses the k-best listpublic KBestList(java.lang.Integer k, SingleDecision decision)
k
- the k-best list sizedecision
- a reference to the single decision that uses the k-best list.protected void initKBestList()
public void reset()
public void add(int actionCode) throws MaltChainedException
actionCode
- the integer representation of candidate actionMaltChainedException
public void addList(int[] predictionList) throws MaltChainedException
MaltChainedException
public void add(java.lang.String symbol) throws MaltChainedException
symbol
- the string representation of candidate actionMaltChainedException
public boolean updateActionWithNextKBest() throws MaltChainedException
MaltChainedException
public int peekNextKBest()
public int getCurrentSize()
public int getK()
protected void setK(int k)
k
- the maximum number of candidatesprotected int getTopCandidateIndex()
protected int getAddCandidateIndex()
public SingleDecision getDecision()
public int getKBestListSize()
public ScoredCandidate getCandidate(int i)
public java.lang.String toString()
toString
in class java.lang.Object
Copyright 2007-2017 Johan Hall, Jens Nilsson and Joakim Nivre.