PyEnchant (Python で動くスペルチェッカー) のインストールと試用(Windows 上)
Windows での,PyEnchant のインストール手順を説明する.
PyEnchant は,英語のスペルチェックと,正しい単語の提案の機能を持ったパッケージである.
URL: https://pyenchant.github.io/pyenchant/
謝辞:このページで紹介するソフトウェアの作者に感謝します.
前準備
Python の準備(Windows,Ubuntu 上)
- Windows での Python 3.10,関連パッケージ,Python 開発環境のインストール(winget を使用しないインストール): 別ページ »で説明
- Ubuntu では,システム Pythonを使うことができる.Python3 開発用ファイル,pip, setuptools のインストール: 別ページ »で説明
【サイト内の関連ページ】
- Python のまとめ: 別ページ »にまとめ
- Google Colaboratory の使い方など: 別ページ »で説明
【関連する外部ページ】 Python の公式ページ: https://www.python.org/
PyEnchant のインストール
- Windows で,コマンドプロンプトを管理者権限で起動する(例:Windowsキーを押し,「cmd」と入力し,「管理者として実行」を選択)
- pip と setuptools の更新
次のコマンドを実行.
* 「 python -m pip install ...」は,Python パッケージをインストールするためのコマンド.
python -m pip install -U pip setuptools
- PyEnchant のインストール
python -m pip install pyenchant
- 動作確認のため,Python プログラムを動かす
https://pyenchant.github.io/pyenchant/tutorial.htmlで公開されているプログラムを使用.
import enchant d = enchant.Dict("en_US") d.check("Hello") d.check("Helo")
from enchant.checker import SpellChecker chkr = SpellChecker("en_US") chkr.set_text("This is sme sample txt with erors.") for err in chkr: print("ERROR:", err.word)