Class StringProb

java.lang.Object
  |
  +--StringProb

public class StringProb
extends java.lang.Object

A string with a probability attached.

Author:
Noah A. Smith
See Also:
Probability, String

Constructor Summary
StringProb(java.lang.String text, double tProb, boolean c)
          Create a StringProb word 'text' with probability 'tProb' and correctness 'c'.
StringProb(java.lang.String text, Probability p)
          Create a StringProb word 'text' with Probability (which includes correctness) 'p'.
 
Method Summary
 boolean correct()
          Return the "correctness" of a StringProb.
 java.awt.Color getColor()
          Return the color of the StringProb.
 Probability prob()
          Return the StringProb (t) probability.
 void setColor(java.awt.Color c)
          Set the color of this StringProb for when it is displayed in a table.
 java.lang.String token()
          Return the StringProb token (word).
 java.lang.String toString()
          Return the StringProb token (word).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringProb

public StringProb(java.lang.String text,
                  double tProb,
                  boolean c)
Create a StringProb word 'text' with probability 'tProb' and correctness 'c'.

StringProb

public StringProb(java.lang.String text,
                  Probability p)
Create a StringProb word 'text' with Probability (which includes correctness) 'p'.
Method Detail

correct

public boolean correct()
Return the "correctness" of a StringProb.

token

public java.lang.String token()
Return the StringProb token (word).

prob

public Probability prob()
Return the StringProb (t) probability.

toString

public java.lang.String toString()
Return the StringProb token (word).
Overrides:
toString in class java.lang.Object

setColor

public void setColor(java.awt.Color c)
Set the color of this StringProb for when it is displayed in a table.

getColor

public java.awt.Color getColor()
Return the color of the StringProb.