diff options
author | CoprDistGit <infra@openeuler.org> | 2023-05-15 06:18:58 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-05-15 06:18:58 +0000 |
commit | 07a76b3ea0cb88fd8747b704094234c95c2db559 (patch) | |
tree | 82c1b922ab28e59aed22c7e16eff4ea6285341d3 | |
parent | dbf52ff1fa25107a9da30f34df21a48dd2f17f6e (diff) |
automatic import of python-rjieba
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-rjieba.spec | 254 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 256 insertions, 0 deletions
@@ -0,0 +1 @@ +/rjieba-0.1.11.tar.gz diff --git a/python-rjieba.spec b/python-rjieba.spec new file mode 100644 index 0000000..1f98736 --- /dev/null +++ b/python-rjieba.spec @@ -0,0 +1,254 @@ +%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 + + +[](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 + + +[](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 + + +[](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 <Python_Bot@openeuler.org> - 0.1.11-1 +- Package Spec generated @@ -0,0 +1 @@ +9494afe9a1ea5a67fd87fa89aee51bd1 rjieba-0.1.11.tar.gz |