Basically I want to make/learn how to make a spell checker (not for my game, just for fun), but I don’t really know how I should go about it.
Do I have to use HTTPService?
Do I have to require the whole english dictionary or something?
Is it even possible?
Well yeah you’d have to require the whole English dictionary, since something being “spelled right” is entirely subject to the dictionary. You could probably find some sort of Pastebin code or something that is just a table of basically every English word, and then get that with httpservice. Then if a player uses a word which isn’t found in that table, then it’s spelled wrong.
Well yikes, you’d probably have to iterate through the whole dictionary and use multiple string functions to see how closely a word matches with the one in the dictionary, and then return the word with the closest match.
local httpService = game:GetService("HttpService")
local Table = httpService:GetAsync("PASTEBIN URL HERE")
local Dictionary = httpService:JSONDecode(Table)
Making an efficient/accurate spell checker isn’t the easiest thing to do. I thought of this implementation on the spot so it might be wrong. You have to first have a list of English words in the correct form. This list will be massive. Then you will have to query your input string to the entire list and find a close match. I have a module for approximate string matching: Simple Fuzzy Search, but it won’t be the most accurate/efficient in this case. The easiest way to find an approximate string is to go through the dictionary linearly (checking one by one) with the module. So the time taken will be dependent on the size of the English dictionary.