gov.nih.nlm.nls.gspell
Class CommonMisspellings

java.lang.Object
  extended bygov.nih.nlm.nls.gspell.CommonMisspellings

public final class CommonMisspellings
extends java.lang.Object

CommonMisspellings is a simple bad word to good word lookup. There is no magic involved here. We've culled several sources for these common misspellings.


Constructor Summary
CommonMisspellings(GlobalBehavior pSettings)
          This is a constructor for CommonMisspellings
CommonMisspellings(java.lang.String pDictionaryName, int pMode)
          This is a constructor for CommonMisspellings
CommonMisspellings(java.lang.String pDictionaryName, java.lang.String pDictionaryDir, int pMode)
          This is a constructor for CommonMisspellings
 
Method Summary
 void cleanup()
          Method cleanup
 void close()
          Method close closes the open db's
 void export(java.io.PrintWriter pWriter)
          Method export
 void find(java.io.BufferedReader pFStream, java.io.PrintWriter pPrintWriter)
          find This method writes to the output the following: inputTerm|candidate|rank|FromMethod|Messages if there are candidates Otherwise, this method writes the following: inputTerm||-9999||No Suggestions Where messages could include "Correct" if the rank = 0; or "No Suggestions" there are no close suggestions.
 Candidate[] find(java.lang.String pTerm)
          Method find
 void flush()
          Method flush
 void index(java.io.BufferedReader pFStream)
          Method index indexes the contents of what somes in from this inputStream This can be a fileStream, or standardinput.
 void index(java.lang.String pBadTerm, java.lang.String pGoodTerm)
          Method index indexes this term
static void main(java.lang.String[] args)
          main
static int run(java.lang.String[] args)
          Method run
(package private)  void save()
          Method save
 void update(java.io.BufferedReader pFStream)
          Method update updates the indexes with terms from the file into the dictionary
 void update(java.lang.String pBadTerm, java.lang.String pGoodTerm)
          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
 

Constructor Detail

CommonMisspellings

public CommonMisspellings(java.lang.String pDictionaryName,
                          int pMode)
                   throws java.lang.Exception
This is a constructor for CommonMisspellings

Parameters:
pDictionaryName - The label to call this dictionary
pMode - GSpell.WRITE_ONLY|GSpell.READ_WRITE|GSpell.READ_ONLY

CommonMisspellings

public CommonMisspellings(java.lang.String pDictionaryName,
                          java.lang.String pDictionaryDir,
                          int pMode)
                   throws java.lang.Exception
This is a constructor for CommonMisspellings

Parameters:
pDictionaryName - The label to call this dictionary
pDictionaryDir - The dir that the Dictionary is going to be placed in.
pMode - GSpell.WRITE_ONLY|GSpell.READ_WRITE|GSpell.READ_ONLY

CommonMisspellings

public CommonMisspellings(GlobalBehavior pSettings)
                   throws java.lang.Exception
This is a constructor for CommonMisspellings

Parameters:
pSettings - Options that incude truncation, max candidates ...
Method Detail

index

public void index(java.io.BufferedReader pFStream)
           throws java.lang.Exception
Method index indexes the contents of what somes in from this inputStream This can be a fileStream, or standardinput. The input is expected to be in the form of badTerm|goodTerm. Rows that start with # are ignored.

Parameters:
pFStream -
Throws:
java.lang.Exception

index

public void index(java.lang.String pBadTerm,
                  java.lang.String pGoodTerm)
           throws java.lang.Exception
Method index indexes this term

Parameters:
pBadTerm -
pGoodTerm -
Throws:
java.lang.Exception

update

public void update(java.io.BufferedReader pFStream)
            throws java.lang.Exception
Method update updates the indexes with terms from the file into the dictionary

Parameters:
pFStream -
Throws:
java.lang.Exception

update

public void update(java.lang.String pBadTerm,
                   java.lang.String pGoodTerm)
            throws java.lang.Exception
Method update adds this term to the dictionary

Parameters:
pBadTerm -
pGoodTerm -
Throws:
java.lang.Exception

find

public void find(java.io.BufferedReader pFStream,
                 java.io.PrintWriter pPrintWriter)
          throws java.lang.Exception
find This method writes to the output the following: inputTerm|candidate|rank|FromMethod|Messages if there are candidates Otherwise, this method writes the following: inputTerm||-9999||No Suggestions Where messages could include "Correct" if the rank = 0; or "No Suggestions" there are no close suggestions.

Parameters:
pFStream -
pPrintWriter -
Returns:
Candidate[]
Throws:
java.lang.Exception

find

public Candidate[] find(java.lang.String pTerm)
                 throws java.lang.Exception
Method find

Parameters:
pTerm -
Returns:
Candidate[]
Throws:
java.lang.Exception

cleanup

public void cleanup()
             throws java.lang.Exception
Method cleanup

Throws:
java.lang.Exception

close

public void close()
           throws java.lang.Exception
Method close closes the open db's

Throws:
java.lang.Exception

flush

public void flush()
           throws java.lang.Exception
Method flush

Throws:
java.lang.Exception

export

public void export(java.io.PrintWriter pWriter)
            throws java.lang.Exception
Method export

Parameters:
pWriter -
Throws:
java.lang.Exception

run

public static int run(java.lang.String[] args)
Method run

Parameters:
args -
Returns:
int

save

void save()
    throws java.lang.Exception
Method save

Throws:
java.lang.Exception

main

public static final void main(java.lang.String[] args)
main

Parameters:
args - The command line input, tokenized


The use and distribution of this material is subject to the terms and conditions included in the file SPECIALIST_NLP_TOOLS_TERMS_AND_CONDITIONS.TXT, located in the root directory of the distribution.