Blog indexRollingšŸ„ŽblogPermalink

I am running a dictionary service

Jake Thoughts ā€” 01 Nov 2021 03:01:12 -0400* edited on Nov 02

I hope everyone had a good halloween! I, unfortunately, went to take a nap and when I woke up I missed halloween :(

Anyway, I am running a dictionary service which may interest some people. Basically, it uses the same dictionary that the wotd service uses but this time you can specify what word to look up. I should mention that because of the dictionary's age, some modern words like 'zoom', 'yeet', etc, will not be present.

It has an API!: $ curl -d "word=the word" https://jakesthoughts.xyz/dictionary

Because of that it is also very easy to impliment into a bash function:

function lookup() {
	curl -d "word=$1" https://jakesthoughts.xyz/dictionary
}

There are other dictionary programs that you can use, of course: Artha, Goldendict, ... there aren't actually that many. Hmm. I haven't used any of these programs so idk if they are good or not. Artha claims to be able to use offline copy which I would be interested in had I not already done this.

Jake you'll just be a creep and see what words I look up!

No - All I will see is someone accessing the url. If this is a major concern, you can download the source script yourself and run it locally.

The script. The dictionary I recommend (it is so old it falls OUT of copyright.)

You can directly visit https://jakesthoughts.xyz/dictionary but I am not applying any stylesheet to it (meaning black text on white background), so your eyeballs will melt if you got used to my current stylesheet. As for Gemini users... I haven't written this yet but I figure the easiest way to serve FCGI content would be with yet another CGI script that queries the FCGI script since Doppio (and I assume many other Gemini servers) don't do FCGI.

Enjoy!

Ok, I have written the script for Gemini users but unfortunately it is not as anonymous as I would like, since it uses GET. But you can look up words on the Capsule now~!


Other thoughts

Jake on 2021-11-02,14:45:24 said:

';=GMI' .... hmm. my script needs some work.

Jake on 2021-11-02,21:37:36 said:

all better!

Jake on 2021-11-04,20:17:58 said:

I have improved the script. it now does the following: results are now better for human consumption, a rudimentary spellchecker. due to the way the spellchecker works I intentionally misspell somethings and see some new words and definitions that I have never seen before! it is a lot of fun.

a on 2021-11-07,18:59:18 said:

Interesting.

Jake on 2021-11-07,23:25:41 said:

v1.6 is planned to optimize the 'else' block if the word the user submits doesn't exist. However, I am not really sure how to go about this besides break up each word based on what their first character is, otherwise the script /really/ goes through all 100k words each time. Still fast as you can see, but I am assuming the user has at least gotten the first character correct so the dictionary should reflect that. I'll work on it later. if you want to see the individual versions: https://jakesthoughts.xyz/data/dictionary.pl.v1.x where x, at the moment, can range from 2 to 5. Obviously with each release the version number will be incimented by one. Lastest (linked in the post) is just a symlink to the lastest version... I am realizing that 'lastest' isn't a word lol

Jake on 2021-11-08,22:53:33 said:

v1.6: misspelling of words should not parse though 100k words anymore and instead parse based on the first character. v1.7: badly mangled words should return something as the string distance limit increases (up to 6) if spell checker doesn't return something.

Jake on 2021-11-08,22:55:40 said:

Besides 'prettifying' the code I do no see myself adding anything else to this. This should be basically completely done. I am totally content with how it works at the moment.

Jake on 2021-11-23,07:52:04 said:

I kinda wanna add a thesaurus...

Jake on 2021-12-07,14:49:45 said:

v1.8: whitespace as initial input causes warnings - fixed v1.9: Made it so that this script only accepts word|api as key inputs, and added checking for such (as to not have warnings clog up the logs)

Jake on 2022-02-25,08:43:16 said:

this script uses a bit of memory so it will often be 503. Oh well

Due to abuse (the comments you see now are not abuse), commenting will be disabled for sometime. Send an email or something.