org.apache.lucene.spelt
Class SpellReader.Word

Object
  extended by SpellReader.Word
Enclosing class:
SpellReader

private final class SpellReader.Word
extends Object

Keeps track of a single word, either an original or suggested word.


Field Summary
 int freq
           
 float freqBoost
           
 String metaphone
           
private  TRStringDistance2 mphDist
           
 SpellReader.Word orig
           
 float score
           
 String word
           
private  TRStringDistance2 wordDist
           
 
Constructor Summary
SpellReader.Word(SpellReader.Word inOrig, String word, int freq)
          Constructor for suggested replacement words
SpellReader.Word(String word)
          Contructor for original words
 
Method Summary
private  void align(PrintWriter w, String s, int width)
           
private  float calcFreqBoost(int[] termFreqs, int freq)
          Calculate a boost factor based on the frequency of a term.
 void debug(PrintWriter w)
          Dump debugging output about this word
 boolean equals(SpellReader.Word other)
           
 int length()
           
 int mphDist(String other)
           
 String toString()
           
 int wordDist(String other)
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

word

public String word

orig

public SpellReader.Word orig

freq

public int freq

metaphone

public String metaphone

wordDist

private TRStringDistance2 wordDist

mphDist

private TRStringDistance2 mphDist

score

public float score

freqBoost

public float freqBoost
Constructor Detail

SpellReader.Word

public SpellReader.Word(String word)
                 throws IOException
Contructor for original words

Throws:
IOException

SpellReader.Word

public SpellReader.Word(SpellReader.Word inOrig,
                        String word,
                        int freq)
                 throws IOException
Constructor for suggested replacement words

Throws:
IOException
Method Detail

length

public int length()

equals

public boolean equals(SpellReader.Word other)

wordDist

public int wordDist(String other)

mphDist

public int mphDist(String other)

toString

public String toString()
Overrides:
toString in class Object

debug

public void debug(PrintWriter w)
Dump debugging output about this word


align

private void align(PrintWriter w,
                   String s,
                   int width)

calcFreqBoost

private float calcFreqBoost(int[] termFreqs,
                            int freq)
Calculate a boost factor based on the frequency of a term.