Joshua
open source statistical hierarchical phrase-based machine translation system
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
joshua.ui.tree_visualizer.Node Class Reference
Collaboration diagram for joshua.ui.tree_visualizer.Node:
[legend]

List of all members.

Public Member Functions

 Node (String name, boolean isSource)
 Node (String name, Node parent, boolean isSource)
String toString ()
void setSourceSpan (int start, int end)
void setSourceStart (int x)
void setSourceEnd (int x)
boolean isSource ()
int sourceStart ()
int sourceEnd ()
String source (String src)
void setCounterpart (Node n)
Node getCounterpart ()
boolean isHighlighted ()
void setHighlighted (boolean b)

Static Public Attributes

static final String DELIM = "[\\{\\}\\-]"

Private Attributes

String name
int sourceStart
int sourceEnd
boolean isSource
Node counterpart = null
boolean isHighlighted = false

Detailed Description

A representation of a node in a derivation tree. The derivation tree class itself is parameterized in terms of this class and the DerivationEdge class. A Node may represent either a non-terminal symbol or one or more terminal symbols of the derivation.


Constructor & Destructor Documentation

joshua.ui.tree_visualizer.Node.Node ( String  name,
boolean  isSource 
)

Constructor used for root nodes or nodes whose parent is not given.

Parameters:
namea String that represents the symbols at this node
isSourcea boolean saying whether this is a source-side node

Here is the call graph for this function:

joshua.ui.tree_visualizer.Node.Node ( String  name,
Node  parent,
boolean  isSource 
)

Constructor for nodes whose parent is known.

Parameters:
namea String that represents the symbols at this node
parentthe parent of this node
isSourcea boolean saying whether this is a source-side node

Here is the call graph for this function:


Member Function Documentation

Returns the node that represents that other-side node that has been aligned with this node.

Returns:
this node's counterpart

Here is the caller graph for this function:

Here is the caller graph for this function:

Returns whether this node is part of a source-side or target-side derivation tree.

Returns:
true if the node is part of a source-side tree, false otherwise

Here is the caller graph for this function:

Sets this node's counterpart to the given node.

Here is the call graph for this function:

Here is the caller graph for this function:

Sets the index after the last source word that is aligned with this node.

Parameters:
xthe value to set

Here is the call graph for this function:

void joshua.ui.tree_visualizer.Node.setSourceSpan ( int  start,
int  end 
)

Sets the indices of the source sentence that are aligned with this node.

Parameters:
startthe index of the first source word that is aligned
endthe index after the last source word that is aligned

Here is the call graph for this function:

Here is the caller graph for this function:

Sets the index of the first source word that is aligned with this node.

Parameters:
xthe value to set the index

Here is the call graph for this function:

String joshua.ui.tree_visualizer.Node.source ( String  src)

Returns the complete source phrase that is aligned with this node. We join together all the source words from start to end using one space per join.

Parameters:
srcthe source sentence
Returns:
a substring of the source sentence that is aligned with this node

Here is the call graph for this function:

Returns an index into the source sentence that is one later than the last word that is aligned with this node.

Returns:
one plus the index of the last source word aligned with this node

Here is the caller graph for this function:

Returns an index into the source sentence that is the first word aligned with this node.

Returns:
the index of the first source word aligned with this node

Here is the caller graph for this function:

Returns a string representation of this node. That is, it returns the name of a non-terminal, or terminals that have been joined with spaces.

Returns:
a String representation of this node

Here is the caller graph for this function:


Member Data Documentation

If this node is a node holding terminal symbols, a pointer to the node that represents symbols that have been aligned with it.

final String joshua.ui.tree_visualizer.Node.DELIM = "[\\{\\}\\-]" [static]

A regex used to extract source-side alignments from annotated non-terminals.

A boolean to let the renderer know whether this vertex is highlighted.

Indicates whether this node is part of the source-side of target- side derivation tree.

The label to be shown on the node. If the node is a non-terminal symbol, it is the name of the symbol. Otherwise, it is terminal symbols joined with spaces.

Index into the source sentence of the last word that is aligned with this node.

Index into the source sentence of the first word that is aligned with this node.