⌨️ECorrect | New Autocorrect Module

ECorrect is an autocorrect module that I made in my free time. It was pretty slow but I made a few improvements to take the time from ~20s down to around ~0.5-0.6 depending on the settings.

:open_book:How it works

ECorrect uses a library of 4.8 million words (no curse words). And runs a algorithm to get the closest words matching yours. I took a list of 4.8m words and wrote a python script to make it into a lua readable format. Then I used rojo to place the file inside my project as every time I would paste it my studio would crash.

:nerd_face:Docs

local ECorrect = require(script.ECorrect)

local myWord = "Healo" -- "Hello"
ECorrect:GetWords(
    player: Player, -- Don't need player if using on client
    word: string, -- The word to filter
    editDistance: number, -- String match distance (lower - more precise but slower)
    amount: number?, -- How many words to return
    delay: number?, -- How long the code will yield while searching
    sort: boolean?, -- Will the words be sorted (perfered)
    lowercase: boolean?, -- Will the returned words be lowercase (the list has some uppercase)
    filter: boolean? -- Will the words returned be filtered (perfered)
)

Thanks for reading and using this module!
Yes, I know it’s not the best out there as it’s slow, buggy, sloppy code. But it was a small project to help me learn.

:arrow_down_small:Pending

:warning:WARNING: DON’T OPEN THE WORDS FILE, YOU WILL CRASH

Got banned for a day because I got the one with swear words by accident. Updating soon.

12 Likes

Wow very interesting this is the first time I’ve seen auto correct for chat on roblox, good job man, but of course there is something to consider, regarding Auto correction which sometimes justifies our word and replaces it with a curse word, overall great job​:grin::+1:

2 Likes