MaltParser 1.4.1

org.maltparser.parser.history.kbest
Class KBestList

java.lang.Object
  extended by org.maltparser.parser.history.kbest.KBestList
Direct Known Subclasses:
ScoredKBestList

public class KBestList
extends Object

Since:
1.1
Author:
Johan Hall

Field Summary
protected  int addCandidateIndex
           
protected  SingleDecision decision
           
protected  int k
           
protected  ArrayList<Candidate> kBestList
           
protected  int topCandidateIndex
           
 
Constructor Summary
KBestList(Integer k, SingleDecision decision)
          Creates a k-best list
KBestList(SingleDecision decision)
          Creates a unrestricted k-best list
 
Method Summary
 void add(int actionCode)
          Adds a candidate to the k-best list
 void add(String symbol)
          Adds a candidate to the k-best list
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 setDecision(SingleDecision decision)
          Sets a reference to the decision that owns the k-best list.
protected  void setK(int k)
          Sets the maximum number of candidates in the k-best list
 String toString()
           
 boolean updateActionWithNextKBest()
          Updates the corresponding single decision with the next value in the k-best list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

kBestList

protected ArrayList<Candidate> kBestList

k

protected int k

topCandidateIndex

protected int topCandidateIndex

addCandidateIndex

protected int addCandidateIndex

decision

protected SingleDecision decision
Constructor Detail

KBestList

public KBestList(SingleDecision decision)
Creates a unrestricted k-best list

Parameters:
decision - a reference to the single decision that uses the k-best list

KBestList

public KBestList(Integer k,
                 SingleDecision decision)
Creates a k-best list

Parameters:
k - the k-best list size
decision - a reference to the single decision that uses the k-best list.
Method Detail

initKBestList

protected void initKBestList()

reset

public void reset()
Resets the k-best list


add

public void add(int actionCode)
         throws MaltChainedException
Adds a candidate to the k-best list

Parameters:
actionCode - the integer representation of candidate action
Throws:
MaltChainedException

add

public void add(String symbol)
         throws MaltChainedException
Adds a candidate to the k-best list

Parameters:
symbol - the string representation of candidate action
Throws:
MaltChainedException

updateActionWithNextKBest

public boolean updateActionWithNextKBest()
                                  throws MaltChainedException
Updates the corresponding single decision with the next value in the k-best list.

Returns:
true if decision has been updated, otherwise false
Throws:
MaltChainedException

peekNextKBest

public int peekNextKBest()

getCurrentSize

public int getCurrentSize()
Returns the current size of the k-best list

Returns:
the current size of the k-best list

getK

public int getK()
Returns the maximum number of candidates in the k-best list.

Returns:
the maximum number of candidates in the k-best list

setK

protected void setK(int k)
Sets the maximum number of candidates in the k-best list

Parameters:
k - the maximum number of candidates

getTopCandidateIndex

protected int getTopCandidateIndex()

getAddCandidateIndex

protected int getAddCandidateIndex()

getDecision

public SingleDecision getDecision()
Returns a single decision object

Returns:
a single decision object

setDecision

protected void setDecision(SingleDecision decision)
Sets a reference to the decision that owns the k-best list.

Parameters:
decision - a reference to the decision that owns the k-best list

getKBestListSize

public int getKBestListSize()

getCandidate

public ScoredCandidate getCandidate(int i)

toString

public String toString()
Overrides:
toString in class Object

MaltParser 1.4.1

Copyright 2007-2010 Johan Hall, Jens Nilsson and Joakim Nivre.