The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: doug@cs.dartmouth.edu (Doug McIlroy)
Subject: [TUHS] Spell - was tmac: Move macro diagnostics away from `quotes'
Date: Wed, 22 Nov 2017 20:05:23 -0500	[thread overview]
Message-ID: <201711230105.vAN15NI6026629@coolidge.cs.Dartmouth.EDU> (raw)

Repeat, slightly modified, of a previous post that got
shunted to the attachment heap.

>   I am curious if anyone on the list remembers much
> about the development of the first spell checkers in Unix?

Yes, intimately. They had no relationship to the PDP 10.

The first one was a fantastic tour de force by Bob Morris,
called "typo". Aside from the file "eign" of the very most common
English words, it had no vocabulary. Instead it evaluated the
likelihood that any particular word came from a source with the
same letter-trigram frequencies as the document as a whole. The
words were then printed in increasing order of likelihood. Typos
tended to come early in the list.

Typo, introduced in v3, was very popular until Steve Johnson wrote
"spell", a remarkably short shell script that (efficiently) looks
up a document's words in the wordlist of Webster's Collegiate
Dictionary, which we had on line. The only "real" coding he did
was to write a simple affix-stripping program to make it possible
to look up plurals, past tenses, etc. If memory serves, Steve's
program is described in Kernighan and Pike. It appeared in v5.

Steve's program was good, but the dictionary isn't an ideal source
for real text, which abounds in proper names and terms of art.
It also has a lot of rare words that don't pull their weight in
a spell checker, and some attractive nuisances, especially obscure
short words from Scots, botany, etc, which are more likely to
arise in everyday text as typos than by intent. Given the basic
success of Steve's program, I undertook to make a more useful
spelling list, along with more vigorous affix stripping (and a
stop list to avert associated traps, e.g. "presenation" =
pre+senate+ion"). That has been described in Bentley's "Programming
Pearls" and in http://www.cs.dartmouth.edu/~doug/spell.pdf.

Morris's program and mine labored under space constraints, so
have some pretty ingenious coding tricks. In fact Morris has
a patent on the way he counted frequencies of the 26^3 trigrams
in 26^3 bytes, even though the counts could exceed 255. I did
some heroic (and probabilistic) encoding to squeeze a 30,000
word dictionary into a 64K data space, without severely 
affecting lookup time.

Doug


             reply	other threads:[~2017-11-23  1:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-23  1:05 Doug McIlroy [this message]
2017-11-23  3:11 ` Lyndon Nerenberg
2017-11-24  9:44   ` Tim Bradshaw
2017-11-25  3:25 ` Bakul Shah
  -- strict thread matches above, loose matches on Subject: below --
2017-11-24 15:13 Noel Chiappa
2017-11-24 17:24 ` Will Senn
2017-11-24 15:05 Nelson H. F. Beebe
2017-11-24 17:01 ` Ralph Corderoy
2017-11-24 18:06   ` Nelson H. F. Beebe
2017-11-24 18:17     ` Henry Bent
2017-11-24 20:18       ` Ron Natalie
2017-11-24 22:46   ` Dave Horsfall
2017-11-24 22:57   ` Arthur Krewat
2017-11-22  2:34 [TUHS] Spell - was tmac: Move macro diagnostics away from `quotes\' Doug McIlroy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201711230105.vAN15NI6026629@coolidge.cs.Dartmouth.EDU \
    --to=doug@cs.dartmouth.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).