|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectgov.nih.nlm.nls.gspell.NGrams
NGrams is a spelling suggestion api that suggests nearest neighbor candidates to an incoming term.
| Field Summary | |
static int |
LEFT_MOST
|
static int |
NGRAMS
|
static int |
RIGHT_MOST
|
| Constructor Summary | |
|
NGrams(GlobalBehavior pSettings)
This is a constructor for NGrams |
(package private) |
NGrams(Options pOptions)
Deprecated. |
|
NGrams(java.lang.String[] args)
This is a constructor for NGrams |
| Method Summary | |
GlobalBehavior |
cleanup()
Method cleanup closes up open files, writes to data stores. |
void |
close()
Method close closes the open db's |
(package private) void |
export()
Method export prints out the contents of the store to stdout |
int |
find(java.io.BufferedReader pFStream,
java.io.PrintWriter pPrintStream)
Method find retreives closest neibhors of the terms coming in from the BufferedReader. |
(package private) Candidate[] |
find(FindOptions pFindOptions,
int pLookupType,
java.lang.String pTerm)
Method find retrieves the closest candidates to the input term using either the ngram or leftmost or rightmost matching grams |
Candidate[] |
find(FindOptions pFindOptions,
java.lang.String pTerm)
Method find retrieves the closest candidates to the input term |
Candidate[] |
find(java.lang.String pTerm)
Method find retrieves the closest candidates to the input term |
int |
findLeftMost(java.io.BufferedReader pFStream,
java.io.PrintWriter pPrintStream)
Method findLeftMost retreives everything that starts with the leftmost part of terms coming in from the BufferedReader. |
Candidate[] |
findLeftMost(FindOptions pFindOptions,
java.lang.String pTerm)
Method findLeftMost retrieves candidates that match the leftmost part of the input term |
Candidate[] |
findLeftMost(java.lang.String pTerm)
Method findLeftMost retrieves the strings that match the left most part of the input term |
int |
findRightMost(java.io.BufferedReader pFStream,
java.io.PrintWriter pPrintStream)
Method findRightMost retreives everything that starts with the rightmost part of terms coming in from the BufferedReader. |
Candidate[] |
findRightMost(FindOptions pFindOptions,
java.lang.String pTerm)
Method findRightMost retrieves candidates that match the rightmost part of the input term |
Candidate[] |
findRigtMost(java.lang.String pTerm)
Method findRigtMost retrieves the strings that match the right most part of the input term |
(package private) void |
flush()
Method flush writes to the data stores. |
void |
freeCandidates()
freeCandidates returns the candidates in the candidatePool to the free list |
(package private) int |
index(java.io.BufferedReader fStream)
Method index indexes the contents of what somes in from this inputStream This can be a fileStream, or standardinput. |
(package private) void |
index(java.lang.String pTerm)
Method index indexes this term |
static void |
main(java.lang.String[] args)
This is a test main, whose purpose is to test the functionality of each method developed for this class. |
static int |
run(java.lang.String[] args)
Method run |
void |
save()
|
(package private) int |
update(java.io.BufferedReader pFStream)
Method update updates the indexes with terms from the file into the dictionary |
(package private) void |
update(java.lang.String pTerm)
Method update adds this term to the dictionary |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int NGRAMS
public static final int LEFT_MOST
public static final int RIGHT_MOST
| Constructor Detail |
public NGrams(GlobalBehavior pSettings)
throws java.lang.Exception
public NGrams(java.lang.String[] args)
throws java.lang.Exception
args - NGrams(Options pOptions) throws java.lang.Exception
pOptions - Options that incudes dictionaryName,
truncation, max candidates ...| Method Detail |
int index(java.io.BufferedReader fStream)
throws java.lang.Exception
fStream -
java.lang.Exception
void index(java.lang.String pTerm)
throws java.lang.Exception
pTerm - The word/Term to be indexed.
java.lang.Exception
int update(java.io.BufferedReader pFStream)
throws java.lang.Exception
pFStream -
java.lang.Exception
void update(java.lang.String pTerm)
throws java.lang.Exception
pTerm -
java.lang.Exception
public int find(java.io.BufferedReader pFStream,
java.io.PrintWriter pPrintStream)
throws java.lang.Exception
pFStream - pPrintStream -
java.lang.Exception
public int findLeftMost(java.io.BufferedReader pFStream,
java.io.PrintWriter pPrintStream)
throws java.lang.Exception
pFStream - pPrintStream -
java.lang.Exception
public int findRightMost(java.io.BufferedReader pFStream,
java.io.PrintWriter pPrintStream)
throws java.lang.Exception
pFStream - pPrintStream -
java.lang.Exception
public Candidate[] find(java.lang.String pTerm)
throws java.lang.Exception
pTerm -
java.lang.Exception
public Candidate[] findLeftMost(java.lang.String pTerm)
throws java.lang.Exception
pTerm -
java.lang.Exception
public Candidate[] findRigtMost(java.lang.String pTerm)
throws java.lang.Exception
pTerm -
java.lang.Exception
public Candidate[] find(FindOptions pFindOptions,
java.lang.String pTerm)
throws java.lang.Exception
pFindOptions - pTerm -
java.lang.Exception
public Candidate[] findLeftMost(FindOptions pFindOptions,
java.lang.String pTerm)
throws java.lang.Exception
pFindOptions - pTerm -
java.lang.Exception
public Candidate[] findRightMost(FindOptions pFindOptions,
java.lang.String pTerm)
throws java.lang.Exception
pFindOptions - pTerm -
java.lang.Exception
Candidate[] find(FindOptions pFindOptions,
int pLookupType,
java.lang.String pTerm)
throws java.lang.Exception
pFindOptions - pLookupType - NGRAMS|LEFT_MOST|RIGHT_MOSTpTerm -
java.lang.Exception
public GlobalBehavior cleanup()
throws java.lang.Exception
java.lang.Exceptionpublic void freeCandidates()
public void close()
throws java.lang.Exception
java.lang.Exception
void flush()
throws java.lang.Exception
java.lang.Exception
void export()
throws java.lang.Exception
java.lang.Exceptionpublic static int run(java.lang.String[] args)
args -
public void save()
throws java.lang.Exception
java.lang.Exceptionpublic static final void main(java.lang.String[] args)
args - The command line input, tokenized
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||