|
Joshua
open source statistical hierarchical phrase-based machine translation system
|
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 |
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.
| joshua.ui.tree_visualizer.Node.Node | ( | String | name, |
| boolean | isSource | ||
| ) |
Constructor used for root nodes or nodes whose parent is not given.
| name | a String that represents the symbols at this node |
| isSource | a boolean saying whether this is a source-side node |
| joshua.ui.tree_visualizer.Node.Node | ( | String | name, |
| Node | parent, | ||
| boolean | isSource | ||
| ) |
Constructor for nodes whose parent is known.
| name | a String that represents the symbols at this node |
| parent | the parent of this node |
| isSource | a boolean saying whether this is a source-side node |
Returns the node that represents that other-side node that has been aligned with this node.
| boolean joshua.ui.tree_visualizer.Node.isHighlighted | ( | ) |
| boolean joshua.ui.tree_visualizer.Node.isSource | ( | ) |
Returns whether this node is part of a source-side or target-side derivation tree.
Sets this node's counterpart to the given node.
| void joshua.ui.tree_visualizer.Node.setHighlighted | ( | boolean | b | ) |
| void joshua.ui.tree_visualizer.Node.setSourceEnd | ( | int | x | ) |
Sets the index after the last source word that is aligned with this node.
| x | the value to set |
| void joshua.ui.tree_visualizer.Node.setSourceSpan | ( | int | start, |
| int | end | ||
| ) |
Sets the indices of the source sentence that are aligned with this node.
| start | the index of the first source word that is aligned |
| end | the index after the last source word that is aligned |
| void joshua.ui.tree_visualizer.Node.setSourceStart | ( | int | x | ) |
Sets the index of the first source word that is aligned with this node.
| x | the value to set the index |
| 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.
| src | the source sentence |
Returns an index into the source sentence that is one later than the last word that is aligned with this node.
Returns an index into the source sentence that is the first word aligned with this node.
| String joshua.ui.tree_visualizer.Node.toString | ( | ) |
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.
String representation of this node Node joshua.ui.tree_visualizer.Node.counterpart = null [private] |
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.
boolean joshua.ui.tree_visualizer.Node.isHighlighted = false [private] |
A boolean to let the renderer know whether this vertex is highlighted.
boolean joshua.ui.tree_visualizer.Node.isSource [private] |
Indicates whether this node is part of the source-side of target- side derivation tree.
String joshua.ui.tree_visualizer.Node.name [private] |
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.
int joshua.ui.tree_visualizer.Node.sourceEnd [private] |
Index into the source sentence of the last word that is aligned with this node.
int joshua.ui.tree_visualizer.Node.sourceStart [private] |
Index into the source sentence of the first word that is aligned with this node.