Class Hunspell.Dictionary
java.lang.Object
org.languagetool.rules.spelling.hunspell.Hunspell.Dictionary
- Enclosing class:
Hunspell
Class representing a single dictionary.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a word to the runtime dictionary.voiddestroy()Deallocate the dictionary.Used to query what are word-charactersbooleanmisspelled(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.Returns a list of suggestions
-
Method Details
-
destroy
public void destroy()Deallocate the dictionary. -
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
Check if a word is spelled correctly- Parameters:
word- The word to check.- Returns:
- true if the
wordis not correctly spelled
-
stringToBytes
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
Returns a list of suggestions- Parameters:
word- The word to check and offer suggestions for- Throws:
CharacterCodingException
-
addWord
Adds a word to the runtime dictionary.- Parameters:
word- Word to be added.- Throws:
UnsupportedEncodingException
-