jieba-rs Python binding
Project description
rjieba-py
jieba-rs Python binding.
Installation
pip install rjieba
Usage
import rjieba
print(rjieba.cut('我们中出了一个叛徒'))
print(rjieba.tag('我们中出了一个叛徒'))
Performance
Running on MacBook Pro (15-inch, 2018) 2.2 GHz 6-Core Intel Core i7
In [1]: import jieba
In [2]: import cjieba
In [3]: import rjieba
In [4]: jieba.initialize()
Building prefix dict from the default dictionary ...
Loading model from cache /var/folders/8d/h3lyjgz14296j_lw7chgf5hc0000gp/T/jieba.cache
Loading model cost 0.695 seconds.
Prefix dict has been built successfully.
In [5]: cjieba.initialize()
In [6]: with open('../jieba-rs/examples/weicheng/src/weicheng.txt') as f:
...: txt = f.read()
...:
In [7]: %timeit list(jieba.cut(txt))
1.1 s ± 10.6 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
In [8]: %timeit cjieba.cut(txt)
225 ms ± 3.95 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
In [9]: %timeit rjieba.cut(txt)
106 ms ± 2.01 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
License
This work is released under the MIT license. A copy of the license is provided in the LICENSE file.
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
rjieba-0.1.4.tar.gz
(5.3 kB
view details)
Built Distributions
File details
Details for the file rjieba-0.1.4.tar.gz
.
File metadata
- Download URL: rjieba-0.1.4.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7af198e0f6f23a44b9a64003c7083a6fb1b9865fb8041f12aba0b5c1a80ffe26 |
|
MD5 | 7abc67e0fa053fb93c3b29b36bf76651 |
|
BLAKE2b-256 | b3262e72213dcfe89902fa83f4c8f89310cdc1ee6fbcb93856b3bce128b41e0a |
File details
Details for the file rjieba-0.1.4-cp36-abi3-win_amd64.whl
.
File metadata
- Download URL: rjieba-0.1.4-cp36-abi3-win_amd64.whl
- Upload date:
- Size: 2.7 MB
- Tags: CPython 3.6+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e907b68b5140f394c587b6abd517e40bde8527803082b9bae79acbd3a41d78ca |
|
MD5 | 9dcd83f3f7c9b663d696b655c86f4230 |
|
BLAKE2b-256 | b0c5eabca4d4e48be967bc0cbf21119530d6d6ff19a3ad21eee09d54b3b91f17 |
File details
Details for the file rjieba-0.1.4-cp36-abi3-win32.whl
.
File metadata
- Download URL: rjieba-0.1.4-cp36-abi3-win32.whl
- Upload date:
- Size: 2.7 MB
- Tags: CPython 3.6+, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5bd622ba974556f459405d5d322fe34c0c05a8ec428c27841bc2a92b5962028 |
|
MD5 | 231257d4939e1cfaf67b62762630f74a |
|
BLAKE2b-256 | 91845272ec24461e453b63e15c67e1e9143f6789cd2fe9eb47bf4dccfe3392e6 |
File details
Details for the file rjieba-0.1.4-cp36-abi3-manylinux2010_x86_64.whl
.
File metadata
- Download URL: rjieba-0.1.4-cp36-abi3-manylinux2010_x86_64.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.6+, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.6.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0aef909784f3f87014d4b726673dad4a04967abfdbaab7c79c8b4b0cb8fdc0e3 |
|
MD5 | 79a744ab3620eb85bf936c00bae34ea7 |
|
BLAKE2b-256 | 0cda6498891fd57367aacd6014c24f837282de118e57548b61e42001a2005666 |
File details
Details for the file rjieba-0.1.4-cp36-abi3-macosx_10_9_universal2.whl
.
File metadata
- Download URL: rjieba-0.1.4-cp36-abi3-macosx_10_9_universal2.whl
- Upload date:
- Size: 5.7 MB
- Tags: CPython 3.6+, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.6.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 310e9c536f22b12332f15c6aeb2dfcb32062b59bcb03c5dd55f0cc20ed1707ac |
|
MD5 | 7bfdcabd4d4584a3d5d7772ee2498311 |
|
BLAKE2b-256 | 2b77461cfbf8949a095bcf045d0209e6544bc5d27c24c2fd47550cb9458562f2 |
File details
Details for the file rjieba-0.1.4-cp36-abi3-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: rjieba-0.1.4-cp36-abi3-macosx_10_7_x86_64.whl
- Upload date:
- Size: 2.9 MB
- Tags: CPython 3.6+, macOS 10.7+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.6.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 509d73bc54e9197551ad7e06c1175243c2afe50331ecd72f4f38b5caf76d79fa |
|
MD5 | 07fa40e91e4fe7333da82956dd3d6e8a |
|
BLAKE2b-256 | 95e6ecce54caec10fe62d614c3d54033df5480bb8b1609557f84ce2880f2072b |