%global _empty_manifest_terminate_build 0 Name: python-rjieba Version: 0.1.11 Release: 1 Summary: jieba-rs Python binding License: MIT URL: https://pypi.org/project/rjieba/ Source0: https://mirrors.nju.edu.cn/pypi/web/packages/51/53/6bc9653460d3182383fdd972ee50c167acadc3aca440c9a4fb9ef9a201ad/rjieba-0.1.11.tar.gz %description # rjieba-py ![CI](https://github.com/messense/rjieba-py/workflows/CI/badge.svg) [![PyPI](https://img.shields.io/pypi/v/rjieba.svg)](https://pypi.org/project/rjieba) [jieba-rs](https://github.com/messense/jieba-rs) Python binding. ## Installation ```bash pip install rjieba ``` ## Usage ```python import rjieba print(rjieba.cut('我们中出了一个叛徒')) print(rjieba.tag('我们中出了一个叛徒')) ``` ## Performance Running on MacBook Pro (15-inch, 2018) 2.2 GHz 6-Core Intel Core i7 ```python 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](./LICENSE) file. %package -n python3-rjieba Summary: jieba-rs Python binding Provides: python-rjieba BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip BuildRequires: python3-cffi BuildRequires: gcc BuildRequires: gdb %description -n python3-rjieba # rjieba-py ![CI](https://github.com/messense/rjieba-py/workflows/CI/badge.svg) [![PyPI](https://img.shields.io/pypi/v/rjieba.svg)](https://pypi.org/project/rjieba) [jieba-rs](https://github.com/messense/jieba-rs) Python binding. ## Installation ```bash pip install rjieba ``` ## Usage ```python import rjieba print(rjieba.cut('我们中出了一个叛徒')) print(rjieba.tag('我们中出了一个叛徒')) ``` ## Performance Running on MacBook Pro (15-inch, 2018) 2.2 GHz 6-Core Intel Core i7 ```python 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](./LICENSE) file. %package help Summary: Development documents and examples for rjieba Provides: python3-rjieba-doc %description help # rjieba-py ![CI](https://github.com/messense/rjieba-py/workflows/CI/badge.svg) [![PyPI](https://img.shields.io/pypi/v/rjieba.svg)](https://pypi.org/project/rjieba) [jieba-rs](https://github.com/messense/jieba-rs) Python binding. ## Installation ```bash pip install rjieba ``` ## Usage ```python import rjieba print(rjieba.cut('我们中出了一个叛徒')) print(rjieba.tag('我们中出了一个叛徒')) ``` ## Performance Running on MacBook Pro (15-inch, 2018) 2.2 GHz 6-Core Intel Core i7 ```python 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](./LICENSE) file. %prep %autosetup -n rjieba-0.1.11 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-rjieba -f filelist.lst %dir %{python3_sitearch}/* %files help -f doclist.lst %{_docdir}/* %changelog * Mon May 15 2023 Python_Bot - 0.1.11-1 - Package Spec generated