How would I make a functional dictionary?

Hi! I’m making a word game and need the English dictionary. I did find one, but it isn’t formatted to work in roblox. How would I quickly format it to work in a table? Or is there some other way where I wouldn’t have to format it?

How it should be:

local dictionary = {

	"aardvark",
	"aardwolf",
	"aaron",
	"abacus",
	"abaft",
	"abalone",
	"abandon",
	"abandoned",
	"abandonment",
	"abandons",
	"abase",
	"abased",
	"abasement",
--etc

But instead it’s:

local dictionary = {

	aardvark
	aardwolf
	aaron
	abacus
	abaft
	abalone
	abandon
	abandoned
	abandonment
	abandons
	abase
	abased
	abasement
	abash
--etc

There are 58,000 words, so I can’t format each one in a reasonable amount of time. Is there a better way to go about this?

You can query words using Roblox’s HTTPService and either develop code on your own servers to scrape dictionary pages or use an existing API (I know free services exist) for the purpose. You can just send a Get request too to scrape the necessary parts of the html from pages.

Adding searched words to a cache would also be beneficial.

This way you don’t need to store all 58k words.

Just so you know you can use an online tool to append commas after every word as well. Here’s one that serves the purpose:

Free Online Comma Separator Tool (my favorite one, it can be used to enclose each entry with quotes as well).

2 Likes

Did a little research, and Merriam Webster has its own API here: https://dictionaryapi.com/, but limits requests to 1000 queries per day per key, so make sure you don’t have more than 1000 servers, and only ping it on server start.

Or:
https://dictionaryapi.dev/ (Free)

The best way to do this in my opinion is to develop your own endpoints
or figure out how some existing services provide their data. This way you’re not limited to a set number of queries.

Do they have an endpoint to retrieve every word in existence? If not then I don’t see why every server would necessarily only make 1 request.

1 Like

Bear with me, this should output a table with all 58k words. Use it as a last resort though, it definitely isn’t efficient at all, I wasn’t even able to run it online.

1 Like