|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectgov.nih.nlm.nls.gspell.Cfg
gov.nih.nlm.nls.gspell.Options
Options retrieves options from the commandline
| Field Summary | |
static int |
EXPORT
|
static int |
FIND
|
static int |
HELP
|
static int |
INDEX
|
static int |
UPDATE
|
static int |
VERSION
|
| Constructor Summary | |
Options()
This is a constructor for Options This constructor takes no Options. |
|
Options(java.io.File pDictionary)
This is a constructor for Options |
|
Options(int pMode,
java.lang.String pDictionaryName,
java.lang.String pDictionaryDir)
This is a constructor for Options Use this constructor for indexing and Updating from within your applications |
|
Options(int pMode,
java.lang.String pDictionaryName,
java.lang.String pDictionaryDir,
int pTruncate,
int pConsiderNCandidates,
int pMaxEditDistance)
This is a constructor for Options. |
|
Options(java.lang.String pDictionaryName)
This is a constructor for Options |
|
Options(java.lang.String[] argv)
This is a constructor for Options |
|
Options(java.lang.String pDictionaryDir,
java.lang.String pDictionaryName)
This is a constructor for Options |
|
Options(java.lang.String pDictionaryName,
java.lang.String pDictionaryDir,
int pTruncate,
int pConsiderNCandidates,
int pMaxEditDistance)
This is a constructor for Options. |
|
| Method Summary | |
(package private) java.lang.String |
_makeDir(java.lang.String pDirectory)
Method _makeDir This method creates a dictionaries/dictName dir |
java.lang.String |
get(java.lang.String pAttribute)
get retrieves values for an attribute asked for This method will return a null for attributes asked for which do not exist. |
int |
getAction()
Method getAction retrieves the type of action. |
java.lang.String |
getAspellMode()
Method getAspellMode Retreive the aspell spelling suggestion mode (ultra|fast|normal|bad-spellers) (For aspell Only) |
int |
getCacheSize()
Method getCacheSize gets an estimate of how big to set the cache to hold the grams. |
int |
getConsiderNCandidates()
Method getConsiderNCandidates reports how many candidates to evaluate when processing a query. |
java.lang.String |
getCorpusName()
Method getCorpusName retrieves the name of the corpus to retrieve frequency info from |
int |
getCorrectField()
Method getCorrectField reports the field to pick up the "correct" term from. |
java.lang.String |
getDictionaryDir()
Method getDictionaryDir retrieves the full path of the dictionary directory |
java.lang.String |
getDictionaryName()
Method getDictionaryName retrieves the name of the dictionary |
(package private) java.lang.String |
getDictionaryPath()
Method getDictionaryPath |
(package private) java.lang.String |
getDictionaryPath(java.lang.String pDictionaryName)
Method getDictionaryPath |
boolean |
getFieldedText()
Method getFieldedText |
FindOptions |
getFindOptions()
Method getFindOptions returns a FindOptions Object with options initially set from the global options. |
java.lang.String |
getInputFileName()
Method getInputFileName reports the name of the input file. |
java.io.BufferedReader |
getInputFileReader()
Method getInputFileReader opens and retrieves the inputFileStream given the option --inputFile=xxxxx. |
int |
getMaxEditDistance()
Method getMaxEditDistance reports back the edit distance threshold set to weed out candidates from consideration when the distance is greater than or equal this threshold. |
int |
getMaxReferences()
Method getMaxReferences retrieves the gram with the largest number of documents associated with it, and returns the number of documents of this gram. |
int |
getMode()
Method getMode |
int |
getNumberOfDocuments()
Method getNumberOfDocuments gets the number of words in the dictionary. |
java.lang.String |
getOutputFileName()
Method getOutputFileName gets the name of the output file. |
java.io.PrintWriter |
getOutputFileWriter()
Method getOutputFileWriter. |
boolean |
getReportTime()
Method getReportTime retrieves whether or not to keep and report the time it takes to process a query. |
boolean |
getStrict()
Method getStrict returns true if the --strict option has been set. |
int |
getTermField()
Method getTermField retrieved the field from the fielded text to pick the query term from. |
int |
getTruncate()
Method getTruncate reports the number of candidates to return |
boolean |
getWordLengthHeuristic()
Method getWordLengthHeuristic gets whether or not to use the wordLength heuristic |
void |
makeDir(java.lang.String pDirectoryName)
Method makeDir This method creates a dictionaries/dictName dir and sets the dictionaryDir |
void |
read()
Method read |
(package private) void |
read(java.lang.String pDictionaryName)
Method read This method will take an absolute path to the directory where the dictionary resides, or it will look in the classpath for directories labeled dictionaries for the beginning paths to look for dictionary directory and a config file labeled "dictionary".cfg |
(package private) void |
read(java.lang.String pDictionaryDir,
java.lang.String pDictionaryName)
Method read This method will take an absolute path to the directory where the dictionary resides, or it will look in the classpath for directories labeled dictionaries for the beginning paths to look for dictionary directory and a config file labeled "dictionary".cfg |
void |
readCommandLineArguments(java.lang.String[] argv)
Method readCommandLineArguments Retrieve these options Actions --help --index --update --find --export --reportTime --version Options --dictionary=XXXXX --inputFile=YYYYY --outputFile=ZZZZZ --truncate=N --considerNCandidates=N --maxEditDistance=N --fieldedText --termField=X [ The first field is 1 not 0 ] --correctField=Y --wordSizeHeuristic=true|false --casheSize=Z --strict |
void |
save()
Method save |
(package private) void |
save(java.lang.String pDictionaryName)
Save. |
(package private) void |
set(java.lang.String pKey,
java.lang.String pValue)
Set. |
void |
setAspellMode(java.lang.String pAspellMode)
Method setAspellMode set the aspell spelling suggestion mode (ultra|fast|normal|bad-spellers) (For aspell Only) |
void |
setConsiderNCandidates(int pMaxCandidates)
Method setConsiderNCandidates sets the number of candidates to evaluate when processing a query. |
void |
setCorpusName(java.lang.String pName)
Method setCorpusName sets the name of the corpus to retrieve frequency info from |
void |
setCorrectField(int pField)
Method setCorrectField sets the field to pick up the "correct" term from. |
void |
setDictionaryDir(java.lang.String pDictionaryDir)
Method setDictionaryDir sets the name of the dictionary directory. |
void |
setDictionaryName(java.lang.String pDictionaryName)
Method setDictionaryName sets the name of the dictionary. |
(package private) void |
setDictionaryPath(java.lang.String pDictionaryDir)
Method setDictionaryPath |
void |
setFieldedText(boolean pVal)
Method setFieldedText tells the options that the input text is fielded |
void |
setInputFileName(java.lang.String pFileName)
Method setInputFileName sets the name of the input file. |
void |
setInputFileReader(java.io.BufferedReader pReader)
Method setInputFileReader sets the inputFileStream |
void |
setMaxEditDistance(int pMaxEditDistance)
Method setMaxEditDistance sets a threshold to weed out candidates from consideration when the distance is greater than or equal this number. |
void |
setMode(int pMode)
Method setMode sets the type of mode gspell uses: READ, READ_WRITE, WRITE_ONLY |
void |
setOption(java.lang.String pKey,
java.lang.String pVal)
Method setOption |
void |
setOutputFileName(java.lang.String pFileName)
Method setOutputFileName sets the name of the output file. |
void |
setOutputFileWriter(java.io.PrintWriter pStream)
Method setOutputFileWriter. |
void |
setReportTime(boolean pVal)
Method setReportTime sets whether or not to keep and report the time it takes to process a query. |
void |
setTermField(int pField)
Method setTermField tells the options the field from the fielded text to pick the query term from. |
void |
setTruncate(int pTruncate)
Method setTruncate sets the number of candidates to return |
void |
setWordLengthHeuristic(boolean pVal)
Method setWordLengthHeuristic sets whether or not to use the wordLength heuristic |
java.lang.String |
toString()
Method toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int HELP
public static final int VERSION
public static final int INDEX
public static final int UPDATE
public static final int FIND
public static final int EXPORT
| Constructor Detail |
public Options()
throws GSpellException
GSpellException
public Options(int pMode,
java.lang.String pDictionaryName,
java.lang.String pDictionaryDir)
throws GSpellException
pMode - this should be set to GSpell.CREATE or
GSpell.READ_WRITEpDictionaryName - This is the name of the dictionary. This
needs to be set. This name is both the
name of the created dictionary directory and
this name is prepended to each index file deposited
in the created directory.pDictionaryDir - This is the name leading up to the dictionary
directory path. By default, the programs that
use these options look in the classpath for
a "dictionaries" subdirectory. Set this
pDictionaryDir only when the dictionaries are
not being placed this way.
GSpellException
public Options(java.lang.String pDictionaryName,
java.lang.String pDictionaryDir,
int pTruncate,
int pConsiderNCandidates,
int pMaxEditDistance)
throws GSpellException
pDictionaryName - This is the name of the dictionary. This
needs to be set. This name is both the
name of the created dictionary directory and
this name is prepended to each index file deposited
in the created directory.pDictionaryDir - This is the name leading up to the dictionary
directory path. By default, the programs that
use these options look in the classpath for
a "dictionaries" subdirectory. Set this
pDictionaryDir only when the dictionaries are
not being placed this way.pTruncate - This indicates how many candidates
you want returned. If you don't
have a preference, set this to -1;
The default is set to 10.pConsiderNCandidates - This indicates how many candidates
to compare. On a fast PC, 3000 is a
good number to use, On a slower sun,
use a number under 1000. If you don't
have a preference, set this to -1;
The default is set to 3000.pMaxEditDistance - This indicates to throw out from
consideration any candidates that are
evaluated to be larger than this edit
distance. If you don't have a preference,
set this to -1.
The default is set to 4.
GSpellException
public Options(int pMode,
java.lang.String pDictionaryName,
java.lang.String pDictionaryDir,
int pTruncate,
int pConsiderNCandidates,
int pMaxEditDistance)
throws GSpellException
pMode - GSpell.READ_ONLY|GSpell.READ_WRITEpDictionaryName - This is the name of the dictionary. This
needs to be set. This name is both the
name of the created dictionary directory and
this name is prepended to each index file deposited
in the created directory.pDictionaryDir - This is the name leading up to the dictionary
directory path. By default, the programs that
use these options look in the classpath for
a "dictionaries" subdirectory. Set this
pDictionaryDir only when the dictionaries are
not being placed this way.pTruncate - This indicates how many candidates
you want returned. If you don't
have a preference, set this to -1;
The default is set to 10.pConsiderNCandidates - This indicates how many candidates
to compare. On a fast PC, 3000 is a
good number to use, On a slower sun,
use a number under 1000. If you don't
have a preference, set this to -1;
The default is set to 3000.pMaxEditDistance - This indicates to throw out from
consideration any candidates that are
evaluated to be larger than this edit
distance. If you don't have a preference,
set this to -1.
The default is set to 4.
GSpellException
public Options(java.lang.String[] argv)
throws GSpellException
argv -
GSpellException
public Options(java.lang.String pDictionaryName)
throws GSpellException
pDictionaryName - This is the name of the dictionary. This
needs to be set. This name is both the
name of the created dictionary directory and
this name is prepended to each index file deposited
in the created directory.
By default, the programs that
use these options look in the classpath for
a "dictionaries" subdirectory.
GSpellException
public Options(java.io.File pDictionary)
throws GSpellException
pDictionary -
GSpellException
public Options(java.lang.String pDictionaryDir,
java.lang.String pDictionaryName)
throws GSpellException
pDictionaryDir - This is the name leading up to the dictionary
directory path. By default, the programs that
use these options look in the classpath for
a "dictionaries" subdirectory. Set this
pDictionaryDir only when the dictionaries are
not being placed this way.pDictionaryName - This is the name of the dictionary. This
needs to be set. This name is both the
name of the created dictionary directory and
this name is prepended to each index file deposited
in the created directory.
GSpellException| Method Detail |
public int getAction()
public void readCommandLineArguments(java.lang.String[] argv)
throws GSpellException
argv -
GSpellExceptionpublic java.lang.String getDictionaryName()
public void setDictionaryName(java.lang.String pDictionaryName)
pDictionaryName -
public java.lang.String getDictionaryDir()
throws GSpellException
GSpellExceptionpublic void setDictionaryDir(java.lang.String pDictionaryDir)
pDictionaryDir - This is the name leading up to the dictionary
directory path. By default, the programs that
use these options look in the classpath for
a "dictionaries" subdirectory. Set this
pDictionaryDir only when the dictionaries are
not being placed this way.public java.lang.String getCorpusName()
public void setCorpusName(java.lang.String pName)
public java.io.BufferedReader getInputFileReader()
throws GSpellException
GSpellException
public void setInputFileReader(java.io.BufferedReader pReader)
throws GSpellException
pReader -
GSpellException
public java.io.PrintWriter getOutputFileWriter()
throws GSpellException
GSpellException
public void setOutputFileWriter(java.io.PrintWriter pStream)
throws GSpellException
pStream -
GSpellExceptionpublic final boolean getReportTime()
public final void setReportTime(boolean pVal)
pVal - public final int getTruncate()
public final void setTruncate(int pTruncate)
pTruncate - public final int getConsiderNCandidates()
public final void setConsiderNCandidates(int pMaxCandidates)
pMaxCandidates - public final int getMaxEditDistance()
public final void setMaxEditDistance(int pMaxEditDistance)
pMaxEditDistance - public final boolean getFieldedText()
public final void setFieldedText(boolean pVal)
pVal - True if the input is fieldedpublic final int getTermField()
public final void setTermField(int pField)
pField - The field to pick up the term frompublic final int getCorrectField()
public final void setCorrectField(int pField)
pField - The field to pick up the correct term from.public final java.lang.String getAspellMode()
public final void setAspellMode(java.lang.String pAspellMode)
pAspellMode - "ultra|fast|normal|bad-spellers"public final void setMode(int pMode)
pMode - GSpell.WRITE_ONLY|READ_WRITE|READ_ONLYpublic final void setWordLengthHeuristic(boolean pVal)
pVal - public final boolean getWordLengthHeuristic()
public final int getMode()
public final void setInputFileName(java.lang.String pFileName)
pFileName - public final java.lang.String getInputFileName()
public final void setOutputFileName(java.lang.String pFileName)
pFileName - public final java.lang.String getOutputFileName()
public final int getNumberOfDocuments()
public final int getCacheSize()
public final int getMaxReferences()
public final boolean getStrict()
public final void setOption(java.lang.String pKey,
java.lang.String pVal)
pKey - pVal -
public final void save()
throws GSpellException
GSpellException
public final void read()
throws GSpellException
GSpellExceptionpublic final FindOptions getFindOptions()
public final void makeDir(java.lang.String pDirectoryName)
throws GSpellException
GSpellExceptionpublic final java.lang.String toString()
void read(java.lang.String pDictionaryName)
throws java.lang.Exception
pDictionaryName -
java.lang.Exception
void read(java.lang.String pDictionaryDir,
java.lang.String pDictionaryName)
throws java.lang.Exception
pDictionaryDir - pDictionaryName -
java.lang.Exceptionpublic java.lang.String get(java.lang.String pAttribute)
pAttribute -
void set(java.lang.String pKey,
java.lang.String pValue)
pKey - pValue -
void save(java.lang.String pDictionaryName)
throws java.lang.Exception
pDictionaryName -
java.lang.Exception
java.lang.String _makeDir(java.lang.String pDirectory)
throws java.lang.Exception
pDirectory -
java.lang.Exception
java.lang.String getDictionaryPath()
throws java.lang.Exception
java.lang.Exception
java.lang.String getDictionaryPath(java.lang.String pDictionaryName)
throws java.lang.Exception
pDictionaryName -
java.lang.Exceptionvoid setDictionaryPath(java.lang.String pDictionaryDir)
pDictionaryDir -
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||