|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.Box | +--Sentence
Represents a single sentence and all related data; responsible for information storage as well as visual display. Visually, a Sentence is implemented as a subclass of javax.swing.Box, which basically means it is either a row or column of Words. It provides methods for changing the GUI as well as accessors for information about individual words.
Web
,
Word
, Serialized FormInner Class Summary | |
protected class |
Sentence.WordAdder
Thread utility class which adds all words to the given sentence. |
Inner classes inherited from class javax.swing.Box |
javax.swing.Box.AccessibleBox,
javax.swing.Box.Filler |
Field Summary | |
static int |
HUMAN
Constant for marking human sentences. |
static int |
SOURCE
Constant for marking source sentences. |
static int |
TARGET
Constant for marking target sentences. |
Fields inherited from class javax.swing.Box |
accessibleContext |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
Constructor Summary | |
Sentence(int intype,
int axis)
Creates a new sentence with the given type and axis. |
|
Sentence(Sentence ins,
int axis)
Creates a duplicate of the given sentence on the new axis. |
Method Summary | |
void |
clear()
Clears all data related to this sentence. |
void |
finish()
Finishes initialization of the sentence. |
java.lang.String |
getLanguage()
Returns the language of this sentence. |
int |
getLength()
Returns the number of Words in this sentence. |
java.awt.Dimension |
getMaximumSize()
Overrides Box.getMaximumSize(). |
java.awt.Dimension |
getMinimumSize()
Overrides Box.getMinimumSize(). |
java.awt.Dimension |
getPreferredSize()
Overrides Box.getPreferredSize(). |
double |
getProb()
Returns the probability of this sentence. |
int |
getType()
Returns the type of the sentence. |
java.lang.String |
getTypeString()
Returns a string representing the type of the current sentence. |
Web |
getWeb()
Returns the Web associated with this sentence. |
Word |
getWordAt(int index)
Returns the Word at the given index. |
java.util.Enumeration |
getWords()
Returns an enumeration of the Words in this sentence. |
int |
getWordXLoc(int index)
Returns the x coordinate of the location of the Word at the given index. |
int |
getWordYLoc(int index)
Returns the y coordinate of the location of the Word at the given index. |
boolean |
isHuman()
Returns true if this is a human sentence. |
boolean |
isSource()
Returns true if this is a source sentence. |
boolean |
isTarget()
Returns true if this is a target sentence. |
void |
readDistortions(java.io.StreamTokenizer st)
Reads a distortion table from an alignment file. |
void |
readFertility(java.io.StreamTokenizer st,
boolean corr)
Reads a fertility table from an alignment file. |
void |
readProb(java.io.StreamTokenizer st)
Reads a sentence probability from an alignment file. |
void |
readTranslations(java.io.StreamTokenizer st,
boolean corr,
Sentence oppositeSent)
Reads a translation table from an alignment file. |
void |
readWords(java.io.StreamTokenizer st)
Reads a sentence from an alignment file. |
void |
setLanguage(java.lang.String inl)
Sets the language of this sentence to the given value. |
void |
setProb(double p)
Sets the probability of this sentence to the given value. |
void |
setStreamVisible(int str,
boolean vis)
Displays or hides the given stream and updates the display. |
void |
setWeb(Web w)
Sets the Web associated with this sentence to the given value. |
java.lang.String |
toString()
Returns a string representation of the sentence. |
void |
updateAxis()
Update the sentence to reflect the current web.axis . |
Methods inherited from class javax.swing.Box |
createGlue,
createHorizontalBox,
createHorizontalGlue,
createHorizontalStrut,
createRigidArea,
createVerticalBox,
createVerticalGlue,
createVerticalStrut,
getAccessibleContext,
setLayout |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
addNotify,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getAlignmentX,
getAlignmentY,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getInsets,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paint,
paintComponents,
paramString,
preferredSize,
print,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
removeNotify,
setFont,
update,
validate,
validateTree |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
addPropertyChangeListener,
addPropertyChangeListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
firePropertyChange,
getBackground,
getBounds,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getGraphics,
getHeight,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getSize,
getToolkit,
getTreeLock,
getWidth,
getX,
getY,
gotFocus,
handleEvent,
hasFocus,
hide,
imageUpdate,
inside,
isDisplayable,
isDoubleBuffered,
isEnabled,
isFocusTraversable,
isLightweight,
isOpaque,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
printAll,
processComponentEvent,
processFocusEvent,
processInputMethodEvent,
processKeyEvent,
processMouseEvent,
processMouseMotionEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
removePropertyChangeListener,
removePropertyChangeListener,
repaint,
repaint,
repaint,
repaint,
requestFocus,
reshape,
resize,
resize,
setBackground,
setBounds,
setBounds,
setComponentOrientation,
setCursor,
setDropTarget,
setEnabled,
setForeground,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
setVisible,
show,
show,
size,
transferFocus |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int TARGET
public static final int SOURCE
public static final int HUMAN
Constructor Detail |
public Sentence(int intype, int axis)
public Sentence(Sentence ins, int axis)
Method Detail |
public void readProb(java.io.StreamTokenizer st) throws FormatException
AlnLoader
public void readFertility(java.io.StreamTokenizer st, boolean corr) throws FormatException
AlnLoader
public void readTranslations(java.io.StreamTokenizer st, boolean corr, Sentence oppositeSent) throws FormatException
AlnLoader
public void readDistortions(java.io.StreamTokenizer st) throws FormatException
AlnLoader
public void readWords(java.io.StreamTokenizer st) throws FormatException
AlnLoader
public void updateAxis()
web.axis
.public java.lang.String toString()
public void clear()
public void setStreamVisible(int str, boolean vis)
public int getType()
getTypeString()
,
SOURCE
,
TARGET
,
HUMAN
public java.lang.String getTypeString()
getType()
public boolean isSource()
true
if this is a source sentence.getType()
public boolean isTarget()
true
if this is a target sentence.getType()
public boolean isHuman()
true
if this is a human sentence.getType()
public void setWeb(Web w)
getWeb()
public Web getWeb()
setWeb(Web)
public void setProb(double p)
getProb()
public double getProb()
setProb(double)
public void setLanguage(java.lang.String inl)
getLanguage()
public java.lang.String getLanguage()
setLanguage(String)
public java.util.Enumeration getWords()
Word
public Word getWordAt(int index)
Word
public int getLength()
public int getWordXLoc(int index)
getWordYLoc(int)
public int getWordYLoc(int index)
getWordXLoc(int)
public java.awt.Dimension getPreferredSize()
getMaximumSize()
,
getMinimumSize()
public void finish()
public java.awt.Dimension getMaximumSize()
getPreferredSize()
,
getMinimumSize()
public java.awt.Dimension getMinimumSize()
getMaximumSize()
,
getPreferredSize()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |