standup.lexicon
Class Concept

java.lang.Object
  extended by standup.lexicon.Concept
All Implemented Interfaces:
Serializable, Comparable

public class Concept
extends Object
implements Comparable, Serializable

A semantic concept which can be viewed as an abstract meaning of one or more words. Concepts in the STANDUP lexicon are taken directly from WordNet synsets.

Instances of this class are obtained by calling Dictionary.getConcept(String), which accesses a serialized hashtable, and thus does not require access to the SQL lexical database.

Concepts are essentially read-only objects, they cannot be altered.

Author:
Ruli Manurung
See Also:
Serialized Form

Field Summary
private  String cachedBriefGloss
           
private  LexemeSet cachedLexemes
           
private  String gloss
           
private  String id
           
private  String[] lexemeIDs
           
private static long serialVersionUID
           
 
Constructor Summary
Concept(String id, String gloss, String[] lexemeIDs)
          Constructor that provides all necessary details.
 
Method Summary
 int compareTo(Object arg0)
           
 boolean equals(Object obj)
           
 String getBriefGloss()
          Returns a shortened version of the gloss, i.e.
 String getGloss()
          Returns the full gloss of this Concept.
 String getID()
          Returns the unique ID of this Concept.
 LexemeSet getLexemes()
          Returns a LexemeSet of all Lexemes that mean this Concept.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

id

private final String id

gloss

private final String gloss

lexemeIDs

private final String[] lexemeIDs

cachedBriefGloss

private transient String cachedBriefGloss

cachedLexemes

private transient LexemeSet cachedLexemes
Constructor Detail

Concept

public Concept(String id,
               String gloss,
               String[] lexemeIDs)
Constructor that provides all necessary details. This should only ever be called by ProtoConcept.buildSerializedCache(String) when building the serialized hashtable of Concepts to be used by Dictionary.

Parameters:
id - unique ID -- see STANDUP lexical database documentation for details
gloss - sentence describing this Concept, e.g. a dictionary definition, along with example usage
lexemeIDs - a String array of IDs of Lexemes that mean this Concept
Method Detail

getID

public String getID()
Returns the unique ID of this Concept.

Returns:

getGloss

public String getGloss()
Returns the full gloss of this Concept.

Returns:

getBriefGloss

public String getBriefGloss()
Returns a shortened version of the gloss, i.e. up to the first encountered semicolon. This is roughly the 'dictionary definition' of this Concept, excluding example usage.

Returns:

getLexemes

public LexemeSet getLexemes()
Returns a LexemeSet of all Lexemes that mean this Concept. This method actually creates a cached LexemeSet the first time it is called, and returns the same instance on subsequent calls, so be sure to create a LexemeSet.duplicate() of it if you intend to modify it.

Returns:

hashCode

public int hashCode()
Overrides:
hashCode in class Object

compareTo

public int compareTo(Object arg0)
Specified by:
compareTo in interface Comparable

equals

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