Divide documents by character type
Project description
概要
文字列をひらがな、片仮名、漢字、数字、アルファベットごとに分割するツールです。 英日両文に適用可能ですが、ピリオドを含む一部の用語は適切に分割できない場合があります。 詳しくは、実行サンプルをご確認ください。
セットアップ
pip install 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要素:字種分割したその他記号などのリスト
実行サンプル
['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', '&&&']
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
divide-char-type-0.2.4.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for divide_char_type-0.2.4-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a412e084f9bc05d215f3e86eb3e7c21d32f96125b5dd8376ad89c3a82cfb8c92 |
|
MD5 | 9a9f696187b090ae75f11b290e122e27 |
|
BLAKE2b-256 | 6aa2a8762c745f15bee840332fb7e5766120bc015800f07f74a2260aa6cf4cd1 |