http:, ftp:, and ... dict:?
https://shkspr.mobi/blog/2024/09/http-ftp-and-dict/

I went for a spelunk0 through an ancient codebase a few weeks ago which contained a curious regex that I just couldn't grok1.

{<((https?|ftp|dict|tel):[^\'">\s]+)>}i

I'm familiar with HTTP and FTP. I worked in the mobile industry, so knew that tel:+44... could be used to launch a dialer.

But DICT?!?!?!

It turns out that, lurking on the Internet are Dictionary Servers! They exist to allow you to query dictionaries over a network.

For many years, the Internet community has relied on the "webster" protocol for access to natural language definitions. […] In recent years, the number of publicly available webster servers on the Internet has dramatically decreased. Fortunately, several freely-distributable dictionaries and lexicons have recently become available on the Internet. However, these freely-distributable databases are not accessible via a uniform interface, and are not accessible from a single site.

The (informal) standard was published in 1997 but has kept a relatively low profile since then. You can understand why it was invented - in an age of low-size disk drives and expensive software, looking up data over a dedicated protocol seems like a nifty2 idea.

Then disk size exploded, databases became cheap, and search engines made it easy to look up words.

How it works

You can try it out today!

Run this command in your terminal:

curl dict://dict.org/d:Internet

That will bring back the definition from the server's default dictionary. If you want to look up a word in a specific dictionary - like The Jargon File - you can run:

curl dict://dict.org/d:Internet:jargon

You can even use it for simple translation tasks. For example, to translate English to Japanese:

curl dict://dict.org/d:Internet:fd-eng-jpn

What Else?

Perhaps the easiest way to explore the protocol and server is to use telnet:

telnet dict.org dict

Type the command HELP and help ye shall receive:

113 help text follows
DEFINE database word         -- look up word in database
MATCH database strategy word -- match word in database using strategy
SHOW DB                      -- list all accessible databases
SHOW DATABASES               -- list all accessible databases
SHOW STRAT                   -- list available matching strategies
SHOW STRATEGIES              -- list available matching strategies
SHOW INFO database           -- provide information about the database
SHOW SERVER                  -- provide site-specific information
OPTION MIME                  -- use MIME headers
CLIENT info                  -- identify client to server
AUTH user string             -- provide authentication information
STATUS                       -- display timing information
HELP                         -- display this help information
QUIT                         -- terminate connection

250 ok

That will allow you to see all the dictionaries available - in a variety of languages - and the various commands you can use with them.

Unanswered Questions

  1. Are there any other Dictionary Servers still available on the Internet?
  2. Did the Webster Protocol get specified outside of obscure source code?
  3. Is there something interesting and modern one could do with a DICT server?
  1. v 1: explore natural caves [syn: {cave}, {spelunk}] ↩︎

  2. (/grok/, /grohk/, vt. 1. To understand. Connotes intimate and exhaustive knowledge. ↩︎

  3. nifty \nifty\ adj. 1. Very good; excellent; -- an informal term meaning about the same as {groovy}, sense 1. [informal, 1960's] ↩︎

https://shkspr.mobi/blog/2024/09/http-ftp-and-dict/

#internet

フォロー

RFC2229 Dictionary Server Protocol。へー。curlが対応してるのさすがだ。SHODANで調べる限り日本でdictdを立ち上げてるサーバはなさそう。日本国内の辞書サービスを提供されている事業者様、dictdをご検討ください
---
http:, ftp:, and ... dict:?
shkspr.mobi/blog/2024/09/http-
[参照]

ログインして会話に参加
Fedibird

様々な目的に使える、日本の汎用マストドンサーバーです。安定した利用環境と、多数の独自機能を提供しています。