MyNixOS website logo
Description

Spelling suggestion tool with library and command-line interfaces.

Given a possibly-misspelled word, this tool spits out one or more properly-spelled words in order of likelihood of similarity.

This functionality is exported as a library via Text.SpellingSuggest (suggest) and as a command-line program "thimk" (an old joke)

Running the program "thimk-makedb" is an optional (but highly recommended) step to speed up lookups, permitting reasonable performance on enormous dictionaries by creating a precompiled SQlite database of phonetic codes for a dictionary.

Thimk and spelling-suggest

Spelling word suggestion tool and library
Copyright © 2010 Bart Massey and Greg Weber

This software is licensed under the "3-clause ('new') BSD License". Please see the file COPYING provided with this distribution for license terms.

This package is a newer version of the original package called "thimk".

"thimk" (an old joke) is a command-line spelling word suggestion tool. You give it a possibly-misspelled word, and it spits out one or more properly-spelled words in order of likelihood of similarity.

Thimk is structured as a command-line interface to its spelling-suggest library, originally split out by Greg Weber. You can use this library for other applications also. There is sufficient Haddock to work out how to use it. It is packaged on Hackage as spelling-suggest.

There is little documentation of the thimk command as-of yet, but the usage message from the program should tell everything needed to get started with it.

The idea and name for thimk came from an old program that used to hang around Reed College, probably written by Graham Ross and now apparently lost in the mists of time. See this Usenet post for the one very vague reference I've found on the web (in the SEE ALSO section of the referenced manpage). I originally re-implemented thimk in Nickle some years ago, but that implementation has been slow, clunky, and non-portable.

The current implementation is a bit more sophisticated than I recall the original being. By default it uses a prefilter that discards words with large edit distances from the target, then filters words with a different phonetic code than the target, then presents the top result sorted by edit distance.

The Soundex and Phonix phonetic codes are designed for names, but seem to work about the same with other words. I follow the common practice of not truncating the codes for greater precision, although Phonix does truncate its final "sound" for greater recall.

The latest change to the implementation is an addition of an optional precompiled SQlite database of phonetic codes for the entire dictionary, created with "thimk-makedb". This greatly speeds lookup, permitting reasonable performance on enormous dictionaries.

Building thimk and spelling-suggest requires my parseargs and phonetic-code packages from hackage, as well as edit-distance and sqlite-0.5.1 or newer if you want to build and use the optional phonetic codes database. It is probably easiest to build using cabal-install, which should take care of most everything for you.

--Bart Massey 2012-08-26

Metadata

Version

0.5.2.1

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows