Package com.teamdev.jxbrowser.spellcheck
Interface Dictionary
public interface Dictionary
Provides functionality for working with a spell check dictionary.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds the givenwordto the dictionary and schedules a write to disk.Adds the givenwordsto the dictionary and schedules a write to disk.booleanReturnstrueif the dictionary contains the givenword.booleanRemoves the givenwordfrom the dictionary and schedules a write to disk.Removes the givenwordsfrom the dictionary and schedules a write to disk.words()Returns the words in the current dictionary or an empty collection if the dictionary does not have any word.
-
Method Details
-
words
Collection<String> words()Returns the words in the current dictionary or an empty collection if the dictionary does not have any word.- Throws:
ObjectClosedException- when the engine is closed
-
add
Adds the givenwordto the dictionary and schedules a write to disk.- Parameters:
word- a word to add to the dictionary. It must be UTF8, between 1 and 99 bytes long, and without leading or trailing ASCII whitespace- Returns:
trueif the givenwordis valid and not a duplicate- Throws:
IllegalArgumentException- whenwordis empty or blankObjectClosedException- when the engine is closed
-
add
Adds the givenwordsto the dictionary and schedules a write to disk.- Parameters:
words- a set of words to add to the dictionary. Each word must be UTF8, between 1 and 99 bytes long, and without leading or trailing ASCII whitespace- Returns:
- a list of sanitation errors if
wordscontains duplicates or invalid words, or an empty list if all words were added successfully - Throws:
IllegalArgumentException- whenwordsis emptyObjectClosedException- when the engine is closed- Since:
- 8.14.0
-
remove
Removes the givenwordfrom the dictionary and schedules a write to disk.- Parameters:
word- a word to remove from the dictionary. It must be UTF8, between 1 and 99 bytes long, and without leading or trailing ASCII whitespace- Returns:
trueif the givenwordwas found and removed successfully- Throws:
IllegalArgumentException- whenwordis empty or blankObjectClosedException- when the engine is closed
-
remove
Removes the givenwordsfrom the dictionary and schedules a write to disk.- Parameters:
words- a set of words to remove from the dictionary. Each word must be UTF8, between 1 and 99 bytes long, and without leading or trailing ASCII whitespace- Returns:
- a list of sanitation errors if
wordscontains words that do not exist in the dictionary, or an empty list if all words were removed successfully - Throws:
IllegalArgumentException- whenwordsis emptyObjectClosedException- when the engine is closed- Since:
- 8.14.0
-
has
Returnstrueif the dictionary contains the givenword.- Parameters:
word- a word to check. It must be UTF8, between 1 and 99 bytes long, and without leading or trailing ASCII whitespace- Throws:
IllegalArgumentException- whenwordis empty or blankObjectClosedException- when the engine is closed
-