spelling.suggestion

Spelling suggestion based on the Spelling Corrector found at: norvig.com/spell-correct.html

A word list, big.txt can also be downloaded from the website: norvig.com/big.txt

Synopsis:

buildList(std.file.readText("big.txt").replace(regex(".?!"), " ").split);

if(misspelled(args[1]))
    std.stdio.writeln(giveWord(args[1]));

Members

Aliases

split
alias split = std.regex.split
Undocumented in source.

Functions

buildList
void buildList(Range words)

Takes a Range of words and adds them to the dictionary while at the same time increasing frequency of use.

giveWord
string giveWord(string word)

Give a suggested word based the given word.

main
void main(string[] args)
Undocumented in source. Be warned that the author may not have intended to support it.
misspelled
bool misspelled(string word)

Tells if a given word is misspelled

train
void train(Range words)

Takes a list of words and increases the frequency of use only if the word is spelled correctly

Meta