http://search.cpan.org/~hank/Text-Aspell/
Bill Moseley / Text-Aspell - search.cpan.org
Text-Aspellというモジュールがあります。checkというメソッドに単語を渡すと、その単語が辞書に登録されているのかがわかります。suggestというメソッドは、正しい(と思われる)単語のリストを返してくれます。
単語のチェック
print $speller->check( $word )
? ”$word found¥n”
: ”$word not found!¥n”;
修正候補の取得
my @suggestions = $speller->suggest( $misspelled );
GNU Aspell
Text-AspellはGNU Aspellというライブラリを利用するので、インストールしておく必要があります。
http://search.cpan.org/~jdporter/Lingua-Ispell-0.07/lib/Lingua/I...
Lingua::Ispell.pm - a module encapsulating access to the Ispell program. - search.cpan.org
Lingua::Ispell は ispell と言うスペルチェッカーを使ったモジュールです。
ispell は Unix で大変メジャーですが、レンタルサーバーなどにあらかじめ
インストールされている事は少ないかもしれません。
http://packages.debian.org/stable/text/wamerican
Debian -- wamerican
スペルチェッカーを自作するならば、英語の辞書ファイル(単語のリスト)は
いろいろ有ります。
すばらしい!
すばらしい!