Package com.tagtraum.core.lang
Class SpellChecker
- java.lang.Object
-
- com.tagtraum.core.lang.SpellChecker
-
- Direct Known Subclasses:
SpellCheckerOSX
public abstract class SpellChecker extends Object
Spell checker.- Author:
- Hendrik Schreiber
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SpellChecker()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Range
check(String stringToCheck, int startIndex, String language)
Checks the spelling of a given string.static SpellChecker
getInstance()
SpellChecker instance.abstract String[]
guesses(String stringToCheck, Range range, String language)
-
-
-
Method Detail
-
getInstance
public static SpellChecker getInstance() throws UnsupportedOperationException
SpellChecker instance.- Returns:
- instance
- Throws:
UnsupportedOperationException
- , if the spellchecker cannot be provided by the OS or another library
-
check
public abstract Range check(String stringToCheck, int startIndex, String language)
Checks the spelling of a given string.- Parameters:
stringToCheck
- stringstartIndex
- start index (location)language
- language to use (ISO 639-1 or ISO 639-2)- Returns:
- range of first misspelled word or null, if nothing is misspelled
- See Also:
- iso639-2
-
guesses
public abstract String[] guesses(String stringToCheck, Range range, String language)
- Parameters:
stringToCheck
- stringrange
- part of the string to provide guesses for or null if for the whole stringlanguage
- language the string is in (ISO 639-1 or ISO 639-2)- Returns:
- guesses
- See Also:
- iso639-2
-
-