|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jspell.domain.JSpellIndex
public class JSpellIndex
This class manages a hybrid trie/linked list data structure on disk. The data structure contains a trie of phonetic codes, at the leaf node of the trie a linked list is maintained of all the words in that same phonetic grouping. When an attempt to locate a similar word is made the original word is compared against the words in the same phonetic grouping by using an equivalence/similarity scoring algorithm found in the Phonetics class. The first n words with a score greater than a given value are returned to the client.
| Field Summary | |
|---|---|
int |
trialDays
|
static java.lang.StringBuffer |
version
Identifies JSpell dictionary version. |
| Constructor Summary | |
|---|---|
JSpellIndex()
Constructor for the JSpellIndex class. |
|
JSpellIndex(java.lang.String path,
java.lang.String language,
java.lang.String country)
Constructs a JSpellIndex object. |
|
JSpellIndex(java.lang.String path,
java.lang.String language,
java.lang.String country,
java.lang.String jdxversion)
Constructs a JSpellIndex object. |
|
| Method Summary | |
|---|---|
void |
add(java.lang.String word)
Add a word to the dictionary |
void |
close()
Close access to the JSpellIndex. |
int |
getBufferHit()
An int containing the number of buffer 'hits'. |
int |
getBufferMiss()
An int containing the number of buffer 'misses'. |
java.lang.String |
getIndexCountry()
Returns the country of this dictionary file. |
java.lang.String |
getIndexLanguage()
Returns the language of this dictionary file. |
java.lang.String |
getIndexPath()
Returns the location of this dictionary file. |
boolean |
isIndexReady()
Returns the status of the JSpellIndex. |
void |
remove(java.lang.String original)
Remove a word from the dictionary |
void |
resetBufferStatistics()
Clear the number of buffer hits and misses. |
boolean |
search(java.lang.String soundex,
java.lang.String original,
java.lang.String[] suggestions)
Overloaded to call search with true, get suggestions. |
boolean |
search(java.lang.String soundex,
java.lang.String original,
java.lang.String[] suggestions,
boolean getSuggestions)
Search for a given word and soundex code and optionally return suggestions. |
boolean |
search(java.lang.String original,
Suggestions suggestions,
boolean specialCase,
boolean forceUpperCase)
Wraps the search(String, String, String[]) method and performs additional search using lower case word if the original word passed begins with an upper case letter. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.lang.StringBuffer version
public final int trialDays
| Constructor Detail |
|---|
public JSpellIndex()
public JSpellIndex(java.lang.String path,
java.lang.String language,
java.lang.String country)
path - location of this dictionary file.language - language of this dictionary file.country - country of this dictionary file.
public JSpellIndex(java.lang.String path,
java.lang.String language,
java.lang.String country,
java.lang.String jdxversion)
path - location of this dictionary file.language - language of this dictionary file.country - country of this dictionary file.jdxversion - Medical, Legal, Other, specify as string, becomes part of filename| Method Detail |
|---|
public int getBufferHit()
public int getBufferMiss()
public void resetBufferStatistics()
public java.lang.String getIndexLanguage()
public java.lang.String getIndexCountry()
public java.lang.String getIndexPath()
public final void close()
public final boolean isIndexReady()
public final void add(java.lang.String word)
word - a String representing an individual word.public final void remove(java.lang.String original)
original - a String representing an individual word.
public final boolean search(java.lang.String original,
Suggestions suggestions,
boolean specialCase,
boolean forceUpperCase)
throws java.io.IOException
original - a String representing a word.suggestions - a Suggestions object.specialCase - true or false, should word be proper.forceUpperCase - true or false, should word be UPPER CASE.
java.io.IOException - an Exception object.
public boolean search(java.lang.String soundex,
java.lang.String original,
java.lang.String[] suggestions)
throws java.io.IOException
soundex - a String representing the phonetic code.original - a String representing the original word.suggestions - a Suggestions object.
java.io.IOException - an Exception object.
public boolean search(java.lang.String soundex,
java.lang.String original,
java.lang.String[] suggestions,
boolean getSuggestions)
throws java.io.IOException
getSuggestions - true or false, return suggestions?soundex - a String representing a phonetic code.original - a String representing the original word.suggestions - a Suggestions object.
java.io.IOException - an Exception object.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||