standup.lexicon
Class FClass

java.lang.Object
  extended by standup.lexicon.FClass

public class FClass
extends Object

Abstractly, an FClass defines a subset of the STANDUP lexicon based on a threshold of familiarity scores.

Each FClass has an F-score threshold value, which determines whether a Lexeme belongs to that FClass or not. If a Lexeme's F-score is equal to or higher than an FClass' threshold, it belongs to that FClass.

Aside from defining various methods available to an instance of an FClass, this method also defines five predetermined FClasses, i.e. fc1 to fc5, which are used to define the standup.joke.FLevels used in joke generation:

FClassF-score threshold
fc10.61
fc20.45
fc30.26
fc40.13
fc50

Author:
Ruli Manurung
See Also:
Lexeme.getFamiliarityScore()

Field Summary
static FClass fc1
           
static FClass fc2
           
static FClass fc3
           
static FClass fc4
           
static FClass fc5
           
(package private)  float fScoreThreshold
           
(package private)  String label
           
 
Constructor Summary
FClass(String l, float f)
          Constructor for a new FClass.
 
Method Summary
 boolean equals(Object obj)
           
static FClass getFClass(float fScore)
          Returns the predefined FClass (i.e.
static FClass getFClass(Lexeme lex)
          Returns the predefined FClass (i.e.
(package private)  String getLabel()
          Returns the label of this FClass
 float getThreshold()
          Returns the F-score threshold of this FClass
 int hashCode()
           
 String toString()
           
 boolean validLexeme(Lexeme lexeme)
          Returns true if the given Lexeme's F-score is equal to or higher than this FClass' threshold, false otherwise.
 boolean validScore(float score)
          Returns true if the given score is equal to or higher than this FClass' threshold, false otherwise.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

fc1

public static final FClass fc1

fc2

public static final FClass fc2

fc3

public static final FClass fc3

fc4

public static final FClass fc4

fc5

public static final FClass fc5

label

final String label

fScoreThreshold

final float fScoreThreshold
Constructor Detail

FClass

public FClass(String l,
              float f)
Constructor for a new FClass.

Parameters:
l - the label for the new FClass
f - the F-score threshold for the new FClass
Method Detail

getThreshold

public float getThreshold()
Returns the F-score threshold of this FClass

Returns:

getLabel

String getLabel()
Returns the label of this FClass

Returns:

toString

public String toString()
Overrides:
toString in class Object

validScore

public boolean validScore(float score)
Returns true if the given score is equal to or higher than this FClass' threshold, false otherwise.

Parameters:
score -
Returns:

validLexeme

public boolean validLexeme(Lexeme lexeme)
Returns true if the given Lexeme's F-score is equal to or higher than this FClass' threshold, false otherwise.

Parameters:
lexeme -
Returns:

getFClass

public static FClass getFClass(float fScore)
Returns the predefined FClass (i.e. from fc1 to fc5) with the highest threshold value that is equal to or less than the given F-score.

Parameters:
fScore -
Returns:

getFClass

public static FClass getFClass(Lexeme lex)
Returns the predefined FClass (i.e. from fc1 to fc5) with the highest threshold value that is equal to or less than the given Lexeme's F-score.

Parameters:
lex -
Returns:

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object