Crates.io | pyawabi |
lib.rs | pyawabi |
version | 0.2.2 |
source | src |
created_at | 2020-07-08 10:04:48.516198 |
updated_at | 2020-07-19 11:15:08.122358 |
description | A python wrapper for awabi |
homepage | |
repository | https://github.com/nakagami/pyawabi |
max_upload_size | |
id | 262522 |
size | 7,578 |
pyawabi
is a python warapper for awabi(https://github.com/nakagami/awabi).
$ pip install setuptools-rust
$ pip install pyawabi
>>> import pyawabi
>>> import pprint
>>> pp = pprint.PrettyPrinter()
>>> pp.pprint(pyawabi.awabi.tokenize("すもももももももものうち"))
[('すもも', '名詞,一般,*,*,*,*,すもも,スモモ,スモモ'),
('も', '助詞,係助詞,*,*,*,*,も,モ,モ'),
('もも', '名詞,一般,*,*,*,*,もも,モモ,モモ'),
('も', '助詞,係助詞,*,*,*,*,も,モ,モ'),
('もも', '名詞,一般,*,*,*,*,もも,モモ,モモ'),
('の', '助詞,連体化,*,*,*,*,の,ノ,ノ'),
('うち', '名詞,非自立,副詞可能,*,*,*,うち,ウチ,ウチ')]
>>> pp.pprint(pyawabi.tokenize_n_best("すもももももももものうち", 2))
[[('すもも', '名詞,一般,*,*,*,*,すもも,スモモ,スモモ'),
('も', '助詞,係助詞,*,*,*,*,も,モ,モ'),
('もも', '名詞,一般,*,*,*,*,もも,モモ,モモ'),
('も', '助詞,係助詞,*,*,*,*,も,モ,モ'),
('もも', '名詞,一般,*,*,*,*,もも,モモ,モモ'),
('の', '助詞,連体化,*,*,*,*,の,ノ,ノ'),
('うち', '名詞,非自立,副詞可能,*,*,*,うち,ウチ,ウチ')],
[('すもも', '名詞,一般,*,*,*,*,すもも,スモモ,スモモ'),
('も', '助詞,係助詞,*,*,*,*,も,モ,モ'),
('もも', '名詞,一般,*,*,*,*,もも,モモ,モモ'),
('もも', '名詞,一般,*,*,*,*,もも,モモ,モモ'),
('も', '助詞,係助詞,*,*,*,*,も,モ,モ'),
('の', '助詞,連体化,*,*,*,*,の,ノ,ノ'),
('うち', '名詞,非自立,副詞可能,*,*,*,うち,ウチ,ウチ')]]
>>>