Package com.mrbysco.spellchecker.util
Class SuggestionUtil
java.lang.Object
com.mrbysco.spellchecker.util.SuggestionUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic Stringstatic final List<SuggestionInfo>static final List<LocationData> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddToDictionary(net.minecraft.client.gui.components.EditBox box, String word) Adds a word to the dictionary and then refreshes the suggestionsgetSuggestions(String misspelledWord) Get suggestions for a wordprotected static booleanhoverBoolean(int mouseX, int mouseY, int x, int y, int widthIn, int heigthIn) static voidkeepSuggestion(net.minecraft.client.gui.components.EditBox box, int x, int y, String word, ArrayList<String> suggestions) Keeps the suggested wordstatic voidonKeyPressed(int keyCode, int scanCode, int modifiers, net.minecraft.client.gui.components.EditBox box) Called when a key is pressed in the chat boxstatic voidonMouseClicked(double mouseX, double mouseY, int button, net.minecraft.client.gui.screens.ChatScreen chat) static voidrefreshSuggestions(net.minecraft.client.gui.components.EditBox editBox) Refreshes the suggestions for the current inputstatic StringStrips a word of all non-alphanumeric characters
-
Field Details
-
wordSuggestions
-
wordPosition
-
wronglySpelledWords
-
keptSuggestions
-
currentLocale
-
-
Constructor Details
-
SuggestionUtil
public SuggestionUtil()
-
-
Method Details
-
onKeyPressed
public static void onKeyPressed(int keyCode, int scanCode, int modifiers, net.minecraft.client.gui.components.EditBox box) Called when a key is pressed in the chat box- Parameters:
keyCode-scanCode-modifiers-
-
onMouseClicked
public static void onMouseClicked(double mouseX, double mouseY, int button, net.minecraft.client.gui.screens.ChatScreen chat) -
hoverBoolean
protected static boolean hoverBoolean(int mouseX, int mouseY, int x, int y, int widthIn, int heigthIn) -
addToDictionary
Adds a word to the dictionary and then refreshes the suggestions- Parameters:
box-word-
-
keepSuggestion
public static void keepSuggestion(net.minecraft.client.gui.components.EditBox box, int x, int y, String word, ArrayList<String> suggestions) Keeps the suggested word- Parameters:
box-x-y-word-suggestions-
-
refreshSuggestions
public static void refreshSuggestions(net.minecraft.client.gui.components.EditBox editBox) Refreshes the suggestions for the current input- Parameters:
editBox-
-
getSuggestions
Get suggestions for a word- Parameters:
misspelledWord-- Returns:
- ArrayList of suggestions
-
stripWord
Strips a word of all non-alphanumeric characters- Parameters:
locale-word-- Returns:
-