Skip to main content

Convert Japanese IME user dictionary files

Project description

userdic-py

userdic-ng(Ruby 実装)を Python に移植した、日本語 IME ユーザー辞書変換ツールです。

必要環境

  • Python 3.9 以上

インストール

1) PyPI から入れる(推奨)

python -m pip install userdic-py

インストール後は userdic-py コマンドが使えます。

2) リポジトリから入れる

python -m pip install .

開発中に編集内容をそのまま反映したい場合:

python -m pip install -e .

3) make install でローカル配置する

/usr/local/bin にコマンド、/usr/local/lib/userdic-py にライブラリを配置します。

make install

別のインストール先を使う場合:

make install PREFIX=/path/to/prefix

削除する場合:

make uninstall

使い方

userdic-py [--input-encoding ENCODING] [--output-encoding ENCODING] <from> <to> < input > output

リポジトリを直接実行する場合は、従来どおり ./userdic.py でも動作します。

./userdic.py [--input-encoding ENCODING] [--output-encoding ENCODING] <from> <to> < input > output

<from> / <to> には次を指定できます。

  • mozc
  • google
  • anthy
  • canna
  • atok
  • msime
  • wnn
  • apple
  • generic

--input-encoding / --output-encoding には Python の codec 名を指定します。 例: utf-8, utf-16, utf-16-le, cp932, euc_jp

使用例

userdic-py generic mozc < generic.txt > mozc.txt
userdic-py --input-encoding cp932 --output-encoding utf-8 msime generic < msime.txt > generic.txt

仕様メモ

  • 入力エンコーディング未指定時は utf-16 / cp932 / euc_jp / utf-8 の順で読み取りを試行します。
  • 出力エンコーディング未指定時の既定値:
    • msime, atok: utf-16
    • wnn, canna: euc_jp
    • その他テキスト形式: utf-8
  • apple は plist(XML) 形式を読み書きします。
  • apple 入出力では --input-encoding / --output-encoding は利用できません。

リリース手順

リリース用のツールを用意します。

python -m pip install --upgrade build twine

バージョンは userdic_py/_version.py__version__ を更新します。

配布物を作って検査します。

make check-dist

TestPyPI にアップロードしてインストール確認します。

make publish-test
python -m pip install --index-url https://test.pypi.org/simple/ --no-deps userdic-py
userdic-py --version

問題がなければ PyPI にアップロードします。

make publish

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

userdic_py-0.2.0.tar.gz (24.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

userdic_py-0.2.0-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file userdic_py-0.2.0.tar.gz.

File metadata

  • Download URL: userdic_py-0.2.0.tar.gz
  • Upload date:
  • Size: 24.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for userdic_py-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c7a68a0a942e7370c188680255ade20e762798f89b3a465b1400c30858855ab9
MD5 f869d1d48efe49da44507a1f009176a7
BLAKE2b-256 1a9d67e73e12b2f49f9f98e3884f16db87a5151b1ba62c3f1bfe083561d4407d

See more details on using hashes here.

File details

Details for the file userdic_py-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: userdic_py-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for userdic_py-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5be94faaacab1d448844903079947ffb175dbd86bbd0f1c86f4f2cf0306c46f6
MD5 4dc955e3c0b06972ff46e15fa1d056a0
BLAKE2b-256 3aa8bf37ae50c4eedf66dad6890d79909254d6449f822b7f21909f3e69902a1a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page