|
Twease | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.cornell.med.icb.synonyms.engine.SynonymEngine
public final class SynonymEngine
Enging for persisting and recalling Synonyms.
| Field Summary | |
|---|---|
static String |
ANY_APPLIES_TO
Perform reverseLookup should be false on findSynonym. |
static String |
ANY_SOURCE
Perform reverseLookup should be false on findSynonym. |
static boolean |
DONT_INCLUDE_ALL
Include all appliesTo should be false on findSynonym. |
static boolean |
INCLUDE_ALL
Include all appliesTo should be true on findSynonym. |
static boolean |
NO_REVERSE_LOOKUP
Perform reverseLookup should be false on findSynonym. |
static boolean |
REVERSE_LOOKUP
Perform reverseLookup should be true on findSynonym. |
| Constructor Summary | |
|---|---|
SynonymEngine(String persistenceUnitVal)
Create a new synonym engine for a specific persistence-unit name. |
|
| Method Summary | |
|---|---|
void |
addEmptySynonym(EmptySynonym emptySynonym)
Add a new empty synonym. |
void |
addSynonym(Synonym synonym)
Add a new synonym. |
void |
addSynonyms(List<Synonym> synonyms)
Add a new set of synonyms. |
void |
close()
Close the synonym engine. |
int |
dropAllSynonyms()
Drops all synonyms for a specific source. |
int |
dropSource(String source)
Drops all synonyms for a specific source. |
boolean |
emptySynonymExists(EmptySynonym emptySynonym)
Check if an emptySynonym has been persisted emptySynonym. |
List<EmptySynonym> |
findEmptySynonyms(String dictionaryWord,
String source,
String appliesTo)
Find a list of synonyms for a specific dinctionary word. |
List<EmptySynonym> |
findEmptySynonymsMultiSource(String dictionaryWord,
String[] sources,
String appliesTo)
Find a list of synonyms for a specific dinctionary word. |
List<Synonym> |
findSynonyms(String dictionaryWord,
String source,
String appliesTo,
boolean includeAll,
boolean reverseLookup)
Find a list of synonyms for a specific dinctionary word. |
List<Synonym> |
findSynonymsMultiSource(String dictionaryWord,
String[] sources,
String appliesTo,
boolean includeAll,
boolean reverseLookup)
Find a list of synonyms for a specific dinctionary word. |
textractor.mg4j.io.TextractorWordReader |
getWordReader()
Get the TextractorWordReader to use. |
static boolean |
listContainsDictionaryWord(List<Synonym> synonyms,
String toFind)
Searches a list of synonyms. |
static boolean |
listContainsSynonym(List<Synonym> synonyms,
Synonym toFind)
Searches a list of synonyms. |
static String |
processTerm(String termToProcess)
Use the term processor to process the term or phrase. |
void |
recreateIndexes()
Create or re-create the synonym indexes. |
int |
removeEmptySynonym(EmptySynonym emptySynonym)
Remove the empty synonym as described here. |
static void |
removeSynonymWord(List<Synonym> syns,
String synToRemove)
Remove all synonyms from the list where the synonymWord is synToExclude. |
void |
setWordReader(textractor.mg4j.io.TextractorWordReader wordReaderVal)
Set the TextractorWordReader to use. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final boolean INCLUDE_ALL
public static final boolean DONT_INCLUDE_ALL
public static final boolean REVERSE_LOOKUP
public static final boolean NO_REVERSE_LOOKUP
public static final String ANY_SOURCE
public static final String ANY_APPLIES_TO
| Constructor Detail |
|---|
public SynonymEngine(String persistenceUnitVal)
persistenceUnitVal - The name of the persistence-unit to use.| Method Detail |
|---|
public void setWordReader(textractor.mg4j.io.TextractorWordReader wordReaderVal)
wordReaderVal - the word reader to usepublic textractor.mg4j.io.TextractorWordReader getWordReader()
public void addEmptySynonym(EmptySynonym emptySynonym)
emptySynonym - The emptySynonyn to addpublic int removeEmptySynonym(EmptySynonym emptySynonym)
emptySynonym - the empty synonym to remove
public void addSynonym(Synonym synonym)
synonym - The synonyn to addpublic void recreateIndexes()
public void addSynonyms(List<Synonym> synonyms)
synonyms - The synonyn to add
public List<Synonym> findSynonymsMultiSource(String dictionaryWord,
String[] sources,
String appliesTo,
boolean includeAll,
boolean reverseLookup)
dictionaryWord - the dictionary to find synonyms forsources - the "sources" to find all synonyms for, null for all
sourcesappliesTo - the "appliesTo" to find all synonyms for.includeAll - wither to also include synonyms where appliesTo equals
Synonyms.APPLIES_TO_ALL.reverseLookup - if true, performs a reverse lookup, ie, search
for the requsted dictionaryWord as a synonym, return the synonyms
of the the dictionaryWord of that synonym
public List<Synonym> findSynonyms(String dictionaryWord,
String source,
String appliesTo,
boolean includeAll,
boolean reverseLookup)
dictionaryWord - the dictionary to find synonyms forsource - the "source" to find all synonyms for, null for all
sourcesappliesTo - the "appliesTo" to find all synonyms for.includeAll - wither to also include synonyms where appliesTo equals
Synonyms.APPLIES_TO_ALL.reverseLookup - if true, performs a reverse lookup, ie, search
for the requsted dictionaryWord as a synonym, return the synonyms
of the the dictionaryWord of that synonym
public static void removeSynonymWord(List<Synonym> syns,
String synToRemove)
syns - Synonyms listsynToRemove - remove all synonyms from the list where
the synonymWord is synToExclude
public List<EmptySynonym> findEmptySynonyms(String dictionaryWord,
String source,
String appliesTo)
dictionaryWord - the dictionary to find synonyms forsource - the "source" to find all synonyms for, null for all
sourcesappliesTo - the "appliesTo" to find all synonyms for.
Synonyms.APPLIES_TO_ALL.
public List<EmptySynonym> findEmptySynonymsMultiSource(String dictionaryWord,
String[] sources,
String appliesTo)
dictionaryWord - the dictionary to find synonyms forsources - the "sources" to find all synonyms for, null for all
sourcesappliesTo - the "appliesTo" to find all synonyms for.
Synonyms.APPLIES_TO_ALL.
public boolean emptySynonymExists(EmptySynonym emptySynonym)
emptySynonym - emptySynonym to lookup
public int dropSource(String source)
source - the name of the source to drop synonyms for
public int dropAllSynonyms()
public static String processTerm(String termToProcess)
termToProcess - term or phrase to process
public void close()
public static boolean listContainsSynonym(List<Synonym> synonyms,
Synonym toFind)
synonyms - the list of synonyms to searchtoFind - the synonym to look for in the list
public static boolean listContainsDictionaryWord(List<Synonym> synonyms,
String toFind)
synonyms - the list of synonyms to searchtoFind - the dictionary word to look for in the list
|
Twease | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||