edu.umn.cs.nlp.mt.huangchiang2005
Class Vertex<Edge extends Hyperarc,Parse extends Derivation>

java.lang.Object
  extended by edu.umn.cs.nlp.mt.huangchiang2005.Vertex<Edge,Parse>
Direct Known Subclasses:
ChartCellEntry

public class Vertex<Edge extends Hyperarc,Parse extends Derivation>
extends Object

Version:
$LastChangedDate: 2007-11-05 15:21:19 -0600 (Mon, 05 Nov 2007) $
Author:
Lane Schwartz
See Also:
"Better k-best Parsing" by Liang Huang & David Chiang (IWPT, 2005)

Field Summary
protected  List<Parse> derivations
           
protected  List<Edge> incomingHyperarcs
           
 
Constructor Summary
  Vertex()
          Creates a Vertex with no incoming Hyperarcs.
protected Vertex(List<Edge> incomingHyperarcs)
          Creates a Vertex with an existing list of incoming Hyperarcs.
 
Method Summary
 boolean add(Edge hyperarc)
          Add an incoming Hyperarc to this Vertex.
 List<Edge> backwardStar()
          Get the list of incoming Hyperarcs.
 List<Parse> getBestDerivations(int n)
          Gets a List of the n best Derivations of this Vertex.
 Parse getDerivation(int n)
          Get the nth best Derivation from this Vertex.
 List<Parse> getDerivations()
          Gets a List of all Derivations of this Vertex.
 int inDegree()
          Get the number of incoming Hyperarcs.
 void merge(int k, List<Parse> list)
           
protected static
<Parse extends Derivation>
List<Parse>
merge(int k, List<Parse> listA, List<Parse> listB)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

incomingHyperarcs

protected final List<Edge extends Hyperarc> incomingHyperarcs

derivations

protected List<Parse extends Derivation> derivations
Constructor Detail

Vertex

public Vertex()
Creates a Vertex with no incoming Hyperarcs.


Vertex

protected Vertex(List<Edge> incomingHyperarcs)
Creates a Vertex with an existing list of incoming Hyperarcs.

Parameters:
incomingHyperarcs - The list of incoming Hyperarcs for the Vertex
Method Detail

backwardStar

public List<Edge> backwardStar()
Get the list of incoming Hyperarcs.

Returns:
The list of incoming Hyperarcs

inDegree

public int inDegree()
Get the number of incoming Hyperarcs.

Returns:
The number of incoming Hyperarcs

add

public boolean add(Edge hyperarc)
Add an incoming Hyperarc to this Vertex.

Parameters:
hyperarc - The incoming Hyperarc

getDerivation

public Parse getDerivation(int n)
Get the nth best Derivation from this Vertex.

Parameters:
n - Indicates which Derivation to get
Returns:
The nth best Derivation

getBestDerivations

public List<Parse> getBestDerivations(int n)
Gets a List of the n best Derivations of this Vertex.

Parameters:
n - Indicates how many Derivations to get
Returns:
if merge has been previously called, returns the n best Derivations of this Vertex, else returns an empty List

getDerivations

public List<Parse> getDerivations()
Gets a List of all Derivations of this Vertex.

Returns:
if merge has been previously called, returns all Derivations of this Vertex, else returns an empty List

merge

public void merge(int k,
                  List<Parse> list)

merge

protected static <Parse extends Derivation> List<Parse> merge(int k,
                                                              List<Parse> listA,
                                                              List<Parse> listB)