Twease

edu.cornell.med.icb.synonyms.util
Class SynonymImportTool

java.lang.Object
  extended by edu.cornell.med.icb.synonyms.util.SynonymImportTool

public final class SynonymImportTool
extends Object

Import abbreviations and DYMs from twease query logs.

Author:
Kevin Dorff

Field Summary
static String PERSISTENCE_UNIT_DEFAULT
          The default persistenceUnit as defined by textractor.properties.
 
Constructor Summary
SynonymImportTool()
          Constructor.
SynonymImportTool(String persistenceUnit)
          Constructor.
SynonymImportTool(SynonymEngine synonymEngine)
          Constructor to use if you created the SynonymEngine elsewhere.
 
Method Summary
 void addAbbrs(String term, List<textractor.scoredresult.ScoredResult> terms, String appliesToVal, String source)
          Add ArrayList[AbbreviationTerm] to the synonyms list.
 int dropAll()
          Drop all synonyms in the SynonymEngine.
 int dropSource(String source)
          Drop all synonyms for a single source.
 void finished()
          Call this when you are finished with the ImportTool object if you had import tool create the synonym engine.
 SynonymEngine getSynonymEngine()
           
 void recreateIndexes()
          Recreate the indexes.
 void viewWord(String word)
          View all synonyms (with details) for a single dictionary word.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PERSISTENCE_UNIT_DEFAULT

public static final String PERSISTENCE_UNIT_DEFAULT
The default persistenceUnit as defined by textractor.properties.

Constructor Detail

SynonymImportTool

public SynonymImportTool()
Constructor.


SynonymImportTool

public SynonymImportTool(String persistenceUnit)
Constructor.

Parameters:
persistenceUnit - the jpa persistence-unit name to use.

SynonymImportTool

public SynonymImportTool(SynonymEngine synonymEngine)
Constructor to use if you created the SynonymEngine elsewhere.

Parameters:
synonymEngine - the synonymEngine to use
Method Detail

getSynonymEngine

public SynonymEngine getSynonymEngine()

finished

public void finished()
Call this when you are finished with the ImportTool object if you had import tool create the synonym engine. If you created the SynonymEngine make sure you call .close on it when you are finished with it.


dropAll

public int dropAll()
Drop all synonyms in the SynonymEngine. Probably only works for Oracle.

Returns:
the number of synonyms removed.

recreateIndexes

public void recreateIndexes()
Recreate the indexes. Probably only works for Oracle.


dropSource

public int dropSource(String source)
Drop all synonyms for a single source.

Parameters:
source - the source to drop synonyms for
Returns:
int the number of synonyms dropped

viewWord

public void viewWord(String word)
View all synonyms (with details) for a single dictionary word. This will look up the synonyms across all appliesTo and sources.

Parameters:
word - to find synonyms for

addAbbrs

public void addAbbrs(String term,
                     List<textractor.scoredresult.ScoredResult> terms,
                     String appliesToVal,
                     String source)
Add ArrayList[AbbreviationTerm] to the synonyms list.

Parameters:
term - The dictionaryWord
terms - the abbreviations list
appliesToVal - the appliesTo value for these synonyms
source - the source value for these synonyms

Twease

Copyright © 2006-2007 Institute for Computational Biomedicine, All Rights Reserved.