standup.lexicon
Class LexicalComponents

java.lang.Object
  extended by standup.lexicon.LexicalComponents
All Implemented Interfaces:
Profileable

public class LexicalComponents
extends Object
implements Profileable

A LexicalComponents represents a collection of various CustomLexicons, Topics, and specially designated blacklist CustomLexicons, which logically define the 'working lexicon'.

The lexical components themselves are stored as a ProfileLexicon, to which this class forms the Profileable counterpart (see standup.profiling for details).

The getWorkingLexicon() method returns a LexemeSet that is the union of custom lexicons and topics subtracted by the blacklists.

Author:
Ruli Manurung

Field Summary
private  ProfileLexicon lexicalProfile
           
 
Constructor Summary
LexicalComponents()
           
 
Method Summary
 boolean createProfile(File directory)
          Creates a default profile in the given directory.
 LexemeSet getBlacklist()
           
 ProfileLexicon getProfile()
          Returns the ProfileLexicon currently being used by this LexicalComponents.
 String getProfileFilename()
          Returns the filename for lexical profiles.
 LexemeSet getWorkingLexicon()
          Returns a LexemeSet that contains the 'working lexicon', i.e.
 ProfileLexicon loadProfile(File directory)
          Loads the lexical profile from the specified directory and returns it.
 boolean setProfile(Profile profile, boolean repeat)
          Uses the lexical components specified in the given lexical Profile.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lexicalProfile

private ProfileLexicon lexicalProfile
Constructor Detail

LexicalComponents

public LexicalComponents()
Method Detail

getWorkingLexicon

public LexemeSet getWorkingLexicon()
Returns a LexemeSet that contains the 'working lexicon', i.e. the union of all Lexemes found within this LexicalComponents CustomLexicons and Topics, substracted by the union of all Lexemes found within this LexicalComponents' blacklist CustomLexicons.

Returns:

getBlacklist

public LexemeSet getBlacklist()

createProfile

public boolean createProfile(File directory)
Creates a default profile in the given directory. It uses the default OptionsLexicon contained within the OptionsPackage returned by ProfileManager.getDefaultOptionsPackage().

Specified by:
createProfile in interface Profileable
Parameters:
directory - the directory where the profile is to be created
Returns:
true if the profile was successfully created, false otherwise

getProfile

public ProfileLexicon getProfile()
Returns the ProfileLexicon currently being used by this LexicalComponents.

Specified by:
getProfile in interface Profileable
Returns:
the currently used ProfileLexicon

getProfileFilename

public String getProfileFilename()
Returns the filename for lexical profiles. Currently this is 'lexical.profile'.

Specified by:
getProfileFilename in interface Profileable
Returns:
"lexical.profile"

loadProfile

public ProfileLexicon loadProfile(File directory)
Loads the lexical profile from the specified directory and returns it.

Specified by:
loadProfile in interface Profileable
Parameters:
directory - The directory containing the lexical profile
Returns:
the instantiated ProfileLexicon

setProfile

public boolean setProfile(Profile profile,
                          boolean repeat)
Uses the lexical components specified in the given lexical Profile.

Specified by:
setProfile in interface Profileable
Parameters:
profile - The profile to be used
repeat - whether this is the first time a profile is being set for the current user during this session
Returns:
true if successful, false otherwise.