com.jspell.domain
Class JSpellErrorInfo

java.lang.Object
  extended by com.jspell.domain.JSpellErrorInfo

public class JSpellErrorInfo
extends java.lang.Object

This class encapsulates error information returned by the dictionary accessor.


Constructor Summary
JSpellErrorInfo(JSpellWordBundle wordBundle, java.lang.String[] suggestions)
          Pass a JSpellWordBundle containing information on the checked word such as position and the word itself and the suggested spellings.
 
Method Summary
 int getPosition()
          Return the position in the source text of this word.
 java.lang.String[] getSuggestions()
          Return the suggested words.
 java.lang.String getWord()
          Return the word that was checked (and presumably invalid).
 JSpellWordBundle getWordBundle()
          Return the JSpellWordBundle containing the invalid word and position in source text.
 void setPosition(int position)
          Set the position of this word in the source text.
 java.lang.String toString()
          For debugging only.
 java.lang.String toTokenizedString()
          Returns a JSpellErrorInfo object used by the JSpellServlet class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JSpellErrorInfo

public JSpellErrorInfo(JSpellWordBundle wordBundle,
                       java.lang.String[] suggestions)
Pass a JSpellWordBundle containing information on the checked word such as position and the word itself and the suggested spellings.

Parameters:
wordBundle - a JSpellWordBundle object.
suggestions - an array of Strings representing suggested replacements for this word.
Method Detail

getWord

public final java.lang.String getWord()
Return the word that was checked (and presumably invalid).

Returns:
a String.

getPosition

public final int getPosition()
Return the position in the source text of this word.

Returns:
the position of the word in characters or batch size.

setPosition

public final void setPosition(int position)
Set the position of this word in the source text.

Parameters:
position - the position.

getWordBundle

public final JSpellWordBundle getWordBundle()
Return the JSpellWordBundle containing the invalid word and position in source text.

Returns:
a JSpellWordBundle.

getSuggestions

public final java.lang.String[] getSuggestions()
Return the suggested words.

Returns:
an array of Strings representing suggested replacements for the word.

toString

public final java.lang.String toString()
For debugging only.

Overrides:
toString in class java.lang.Object
Returns:
a String.

toTokenizedString

public final java.lang.String toTokenizedString()
Returns a JSpellErrorInfo object used by the JSpellServlet class.

Returns:
a String.


JSpell SDK - Spell Checker for the Java ™ Platform
Copyright © 2009 Page Scholar Inc, All Rights Reserved - http://www.jspell.com