gov.nih.nlm.nls.gspell
Class MetaphoneRetrieve

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

final class MetaphoneRetrieve
extends java.lang.Object

Metaphone. Lawrence Philips' Metaphone Algorithm is an algorithm which returns the rough approximation of how an English word sounds. The author can be contacted at LFP at dolby com This implementation is a derivitive, taken from Chris Lu's transcription of it into the Java Lexical tools


Constructor Summary
(package private) MetaphoneRetrieve(GlobalBehavior pSettings)
          This is a constructor for MetaphoneRetrieve
(package private) MetaphoneRetrieve(java.lang.String pDictionaryName, int pMode)
          This is a constructor for MetaphoneRetrieve
 
Method Summary
(package private)  void cleanup()
          Method cleanup
(package private)  void close()
          Method close
(package private)  void export()
          Method export
(package private)  int 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.
(package private)  Candidate[] find(FindOptions pFindOptions, java.lang.String pTerm)
          Method find
(package private)  Candidate[] find(java.lang.String pTerm)
          Method find
(package private)  void flush()
          Method flush
(package private)  void freeCandidates()
          Method freeCandidates returns the candidates to the free list to be reused again
(package private)  int index(java.io.BufferedReader pFStream)
          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)
          main
(package private)  void reorganize()
          Method reorganize
(package private) static int run(java.lang.String[] args)
          Method run
(package private)  void save()
          Method 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
 

Constructor Detail

MetaphoneRetrieve

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


MetaphoneRetrieve

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

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

index

int 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. Rows that start with # are ignored.

Returns:
int the number of terms indexed
Throws:
java.lang.Exception

index

void index(java.lang.String pTerm)
     throws java.lang.Exception
Method index indexes this term

Throws:
java.lang.Exception

update

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

Returns:
int the number of terms indexed
Throws:
java.lang.Exception

update

void update(java.lang.String pTerm)
      throws java.lang.Exception
Method update adds this term to the dictionary

Throws:
java.lang.Exception

find

int 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.

Returns:
int the number of terms looked up
Throws:
java.lang.Exception

find

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

Returns:
Candidate[]
Throws:
java.lang.Exception

find

Candidate[] find(FindOptions pFindOptions,
                 java.lang.String pTerm)
           throws java.lang.Exception
Method find

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

freeCandidates

void freeCandidates()
Method freeCandidates returns the candidates to the free list to be reused again


cleanup

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

Throws:
java.lang.Exception

close

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

Throws:
java.lang.Exception

flush

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

Throws:
java.lang.Exception

export

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

Throws:
java.lang.Exception

reorganize

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

Throws:
java.lang.Exception

run

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

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



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.