|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object standup.lexicon.Dictionary
public class Dictionary
A class that has various static methods for obtaining Lexeme
s,
WordForm
s and Concept
s.
The methods in this class return instantiations that are obtained from
serialized hashtables found under /standup/resources/serialized
.
Field Summary | |
---|---|
private static Hashtable<String,Concept> |
concepts
|
private static Hashtable<WordSequence,Set<String>> |
indexSpellingToWordFormIDs
|
private static Hashtable<String,Set<String>> |
indexWordFormIDstoLexemeIDs
|
private static Hashtable<String,Lexeme> |
lexemes
|
private static Dictionary |
me
|
private static String |
serializedConceptsFile
|
private static String |
serializedDir
|
private static String |
serializedIndexSpellingToWordFormIDsFile
|
private static String |
serializedIndexWordFormIDToLexemeIDsFile
|
private static String |
serializedLexemesFile
|
private static String |
serializedWordFormsFile
|
private static Hashtable<String,WordForm> |
wordforms
|
Constructor Summary | |
---|---|
Dictionary()
|
Method Summary | |
---|---|
static LexemeSet |
convertLexemeIDSetToLexemeSet(Set<String> lexemeIDs)
Returns a LexemeSet of Lexeme s whose IDs are contained
within the given Set<String> . |
static Set<WordForm> |
convertWordFormIDSetToWordFormSet(Set<String> wordFormIDs)
Returns a Set<WordForm> of WordForm s whose IDs are
contained within the given Set<String> . |
static Collection<Concept> |
getAllConcepts()
Returns a collection of all known Concept s. |
static LexemeSet |
getAllLexemes()
Returns a collection of all known Lexeme s. |
static Collection<WordForm> |
getAllWordForms()
Returns a collection of all known WordForm s. |
static Concept |
getConcept(String id)
Returns an instance of the Concept with the given ID, or
null if one was not found. |
static Lexeme |
getLexeme(String id)
Returns an instance of the Lexeme with the given ID, or
null if one was not found. |
static LexemeSet |
getSpelledLexemes(WordForm wf)
Returns all Lexeme s whose form is the same as the given
WordForm . |
static LexemeSet |
getSpelledLexemes(WordSequence ws)
Returns all Lexeme s with the given spelling. |
static Set<WordForm> |
getSpelledWordForms(WordSequence ws)
Returns all WordForm s with the given spelling. |
static WordForm |
getWordForm(String id)
Returns an instance of the WordForm with the given ID, or
null if one was not found. |
static void |
loadConcepts()
Loads the serialized hashtable of Concept s. |
static void |
loadIndexSpellingToWordFormIDs()
Loads the serialized index of spelling to WordForm IDs. |
static void |
loadIndexWordFormIDsToLexemeIDs()
Loads the serialized index of WordForm IDs to Lexeme IDs. |
static void |
loadLexemes()
Loads the serialized hashtable of Lexeme s. |
static void |
loadWordForms()
Loads the serialized hashtable of WordForm s. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static Dictionary me
private static Hashtable<String,WordForm> wordforms
private static Hashtable<String,Concept> concepts
private static Hashtable<String,Lexeme> lexemes
private static Hashtable<WordSequence,Set<String>> indexSpellingToWordFormIDs
private static Hashtable<String,Set<String>> indexWordFormIDstoLexemeIDs
private static final String serializedDir
private static final String serializedWordFormsFile
private static final String serializedLexemesFile
private static final String serializedConceptsFile
private static final String serializedIndexSpellingToWordFormIDsFile
private static final String serializedIndexWordFormIDToLexemeIDsFile
Constructor Detail |
---|
public Dictionary()
Method Detail |
---|
public static void loadLexemes()
Lexeme
s.
public static void loadWordForms()
WordForm
s.
public static void loadConcepts()
Concept
s.
public static void loadIndexSpellingToWordFormIDs()
WordForm
IDs.
public static void loadIndexWordFormIDsToLexemeIDs()
WordForm
IDs to Lexeme
IDs.
public static Lexeme getLexeme(String id)
Lexeme
with the given ID, or
null
if one was not found.
id
-
public static WordForm getWordForm(String id)
WordForm
with the given ID, or
null
if one was not found.
id
-
public static Concept getConcept(String id)
Concept
with the given ID, or
null
if one was not found.
id
-
public static LexemeSet getAllLexemes()
Lexeme
s.
public static Collection<WordForm> getAllWordForms()
WordForm
s.
public static Collection<Concept> getAllConcepts()
Concept
s.
public static Set<WordForm> convertWordFormIDSetToWordFormSet(Set<String> wordFormIDs)
Set<WordForm>
of WordForm
s whose IDs are
contained within the given Set<String>
.
wordFormIDs
-
public static LexemeSet convertLexemeIDSetToLexemeSet(Set<String> lexemeIDs)
LexemeSet
of Lexeme
s whose IDs are contained
within the given Set<String>
.
wordFormIDs
-
public static Set<WordForm> getSpelledWordForms(WordSequence ws)
WordForm
s with the given spelling.
ws
- the required spelt form
Set
of all WordForm
s with the given spelling,
or null
if ws
is null
.public static LexemeSet getSpelledLexemes(WordForm wf)
Lexeme
s whose form is the same as the given
WordForm
.
wf
-
LexemeSet
of all Lexeme
s whose
WordForm
is wf
, or null
if wf
is
null
.public static LexemeSet getSpelledLexemes(WordSequence ws)
Lexeme
s with the given spelling.
ws
- the required spelt form
LexemeSet
of all Lexeme
s with the given
spelling, or null
if ws
is null
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |