Class Hunspell.Dictionary
- java.lang.Object
-
- org.languagetool.rules.spelling.hunspell.Hunspell.Dictionary
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addWord(String word)
Adds a word to the runtime dictionary.void
destroy()
Deallocate the dictionary.String
getWordChars()
Used to query what are word-charactersboolean
misspelled(String word)
Check if a word is spelled correctlyprotected byte[]
stringToBytes(String str)
Convert a Java string to a zero terminated byte array, in the encoding of the dictionary, as expected by the hunspell functions.List<String>
suggest(String word)
Returns a list of suggestions
-
-
-
Method Detail
-
destroy
public void destroy()
Deallocate the dictionary.
-
getWordChars
public String getWordChars()
Used to query what are word-characters- Returns:
- A string composed of characters that are parts of words, even if they are not alphabetic.
-
misspelled
public boolean misspelled(String word)
Check if a word is spelled correctly- Parameters:
word
- The word to check.- Returns:
- true if the
word
is not correctly spelled
-
stringToBytes
protected byte[] stringToBytes(String str) throws UnsupportedEncodingException
Convert a Java string to a zero terminated byte array, in the encoding of the dictionary, as expected by the hunspell functions.- Throws:
UnsupportedEncodingException
-
suggest
public List<String> suggest(String word) throws CharacterCodingException
Returns a list of suggestions- Parameters:
word
- The word to check and offer suggestions for- Throws:
CharacterCodingException
-
addWord
public void addWord(String word) throws UnsupportedEncodingException
Adds a word to the runtime dictionary.- Parameters:
word
- Word to be added.- Throws:
UnsupportedEncodingException
-
-