概要
文字列をひらがな、片仮名、漢字、数字、アルファベットごとに分割するツールです。 英日両文に適用可能ですが、ピリオドを含む一部の用語は適切に分割できない場合があります。 詳しくは、実行サンプルをご確認ください。
セットアップ
pip install divide-char-type
アンインストール
pip uninstall divide-char-type
使い方
from divide_char_type import divide_char_type
data = divide_char_type("今日の天気は晴れです。")
print(data[0])
戻り値
- 配列型
- 第0要素:字種分割した全体のリスト
- 第1要素:字種分割した全体の字種タイプリスト
- 第2要素:字種分割したひらがなのリスト
- 第3要素:字種分割したカタカナのリスト
- 第4要素:字種分割した漢字のリスト
- 第5要素:字種分割したアルファベットのリスト
- 第6要素:字種分割した数字のリスト
- 第7要素:字種分割したその他記号などのリスト
字種タイプリスト
- 0:平仮名
- 1:カタカナ
- 2:漢字
- 3:アルファベット
- 4:数字
- 5:その他記号など
実行サンプル
['1.0', ' ', 'is', ' ', 'number', '.']
['1', ',', '000', ' ', 'is', ' ', 'number', '.']
['u.s.a.', ' ', 'is', ' ', 'state', '.']
['u.k', '.', ' ', 'is', ' ', 'state', '.']
['e.g.', ',', ' ', 'th', ',', ' ', 'ch', ',', ' ', 'sh', ',', ' ', 'ph', ',', ' ', 'gh', ',', ' ', 'ng', ',', ' ', 'qu']
['state', ' ', 'include', ' ', 'u.s.', ' ', 'u.s.', ' ', 'is', ' ', 'state', '.']
['state', ' ', 'include', ' ', 'u.k', '.', ' ', 'u.k', '.', ' ', 'is', ' ', 'state', '.']
['u.s.', 'は', '国', 'です', '。']
['u.s', '.', 'は', '国', 'です', '。']
['あいうえおーかきくけこ']
['アイウエオーカキクケコ']
['今日', 'の', '天気', 'は', '晴', 'れです', '。\n', '明日', 'の', '天気', 'は', '曇', 'りです', '。\n']
['&&&', '1.0', '&&&']
実行速度
論文
赤木信也:字種分割ツールの開発と公開,
情報処理学会第85回全国大会講演論文集 2023 (1), 29-30, 2023-02-16
https://cir.nii.ac.jp/crid/1050579753470466176
ライセンス
- divide_char_type
- Python Software Foundation License
- Copyright (C) 2023-2024 Shinya Akagi
Metadata
Release files for divide-char-type 0.2.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| divide-char-type-0.2.9.tar.gz | 4.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| divide_char_type-0.2.9-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 9.5 kB
Release files / divide-char-type-0.2.9.tar.gz
| Download URL | divide-char-type-0.2.9.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c2c47497d0d03002250ae922f565319800d4db06bef9ea1307daadfbbcff5505
|
|
BLAKE2b-256 checksum How to use checksums |
c0fa19b4903a8dcb105e13d4c1b359288feb755e35b3cb371781ece0ccca2e4e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.9
|
Release files / divide_char_type-0.2.9-py2-none-any.whl
| Download URL | divide_char_type-0.2.9-py2-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
59602b2a7811879d9336117b283675f3f2d415e6b1a2e4cd5de81aa977f5abc1
|
|
BLAKE2b-256 checksum How to use checksums |
d70a6da6bc9310adcbac474af4fefc78080fae7ae1b5f85c6c71ef1a4dc98242
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.9
|
Security for divide-char-type 0.2.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.