diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-05-10 04:24:04 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-05-10 04:24:04 +0000 |
| commit | 43fc10e7c64a53135d9623033835573be3f59f42 (patch) | |
| tree | 2a669a5475436d9eb52bafc936d2687a459e1feb | |
| parent | 0886bf8f49864d9fbccc80e6f581e3ca437f6ce3 (diff) | |
automatic import of python-pluralizeropeneuler20.03
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-pluralizer.spec | 213 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 215 insertions, 0 deletions
@@ -0,0 +1 @@ +/pluralizer-1.2.0.tar.gz diff --git a/python-pluralizer.spec b/python-pluralizer.spec new file mode 100644 index 0000000..1c150f6 --- /dev/null +++ b/python-pluralizer.spec @@ -0,0 +1,213 @@ +%global _empty_manifest_terminate_build 0 +Name: python-pluralizer +Version: 1.2.0 +Release: 1 +Summary: Singularize or pluralize a given word useing a pre-defined list of rules +License: MIT +URL: https://github.com/weixu365/pluralizer-py +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/c4/11/5e3e7af16fe46612265e6cfed0f1c8f49fb0cdb424d314154d5a3b364bac/pluralizer-1.2.0.tar.gz +BuildArch: noarch + + +%description +[](https://pypi.org/project/pluralizer/) +[](https://codecov.io/gh/weixu365/pluralizer-py) +[](https://github.com/weixu365/pluralizer-py/actions?query=branch%3Amaster) +[](https://pypistats.org/packages/pluralizer) + +## Why this project? +This repo is simply a Python port of https://github.com/blakeembrey/pluralize which has > 1.4m github usages and 3.5 million downloads per week when I evaluating different libraries. + +> This module uses a pre-defined list of rules, applied in order, to singularize or pluralize a given word. There are many cases where this is useful, such as any automation based on user input. For applications where the word(s) are known ahead of time, you can use a simple ternary (or function) which would be a much lighter alternative. + +I have compared the following alternatives and found https://github.com/blakeembrey/pluralize is the best one for me (most accurate), so ported it into the Python world. +- TextBlob: https://github.com/sloria/TextBlob +- inflect: https://github.com/jazzband/inflect +- NLTK Wordnet: https://www.nltk.org/howto/wordnet.html + + +## Installation +```bash +pip install pluralizer +``` + +## Usage +```python +from pluralizer import Pluralizer + +pluralizer = Pluralizer() + +assert pluralizer.pluralize('apple', 1, False) == 'apple' +assert pluralizer.pluralize('apple', 1, True) == '1 apple' +assert pluralizer.pluralize('apple', 2, False) == 'apples' +assert pluralizer.pluralize('apple', 2, True) == '2 apples' + +assert pluralizer.plural('apple') == 'apples' +assert pluralizer.singular('apples') == 'apple' + +assert pluralizer.isPlural('apples') == True +assert pluralizer.isPlural('apple') == False +assert pluralizer.isSingular('apples') == False +assert pluralizer.isSingular('apple') == True +``` + +## License +MIT + +All credits to https://github.com/blakeembrey/pluralize. + + + + +%package -n python3-pluralizer +Summary: Singularize or pluralize a given word useing a pre-defined list of rules +Provides: python-pluralizer +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-pluralizer +[](https://pypi.org/project/pluralizer/) +[](https://codecov.io/gh/weixu365/pluralizer-py) +[](https://github.com/weixu365/pluralizer-py/actions?query=branch%3Amaster) +[](https://pypistats.org/packages/pluralizer) + +## Why this project? +This repo is simply a Python port of https://github.com/blakeembrey/pluralize which has > 1.4m github usages and 3.5 million downloads per week when I evaluating different libraries. + +> This module uses a pre-defined list of rules, applied in order, to singularize or pluralize a given word. There are many cases where this is useful, such as any automation based on user input. For applications where the word(s) are known ahead of time, you can use a simple ternary (or function) which would be a much lighter alternative. + +I have compared the following alternatives and found https://github.com/blakeembrey/pluralize is the best one for me (most accurate), so ported it into the Python world. +- TextBlob: https://github.com/sloria/TextBlob +- inflect: https://github.com/jazzband/inflect +- NLTK Wordnet: https://www.nltk.org/howto/wordnet.html + + +## Installation +```bash +pip install pluralizer +``` + +## Usage +```python +from pluralizer import Pluralizer + +pluralizer = Pluralizer() + +assert pluralizer.pluralize('apple', 1, False) == 'apple' +assert pluralizer.pluralize('apple', 1, True) == '1 apple' +assert pluralizer.pluralize('apple', 2, False) == 'apples' +assert pluralizer.pluralize('apple', 2, True) == '2 apples' + +assert pluralizer.plural('apple') == 'apples' +assert pluralizer.singular('apples') == 'apple' + +assert pluralizer.isPlural('apples') == True +assert pluralizer.isPlural('apple') == False +assert pluralizer.isSingular('apples') == False +assert pluralizer.isSingular('apple') == True +``` + +## License +MIT + +All credits to https://github.com/blakeembrey/pluralize. + + + + +%package help +Summary: Development documents and examples for pluralizer +Provides: python3-pluralizer-doc +%description help +[](https://pypi.org/project/pluralizer/) +[](https://codecov.io/gh/weixu365/pluralizer-py) +[](https://github.com/weixu365/pluralizer-py/actions?query=branch%3Amaster) +[](https://pypistats.org/packages/pluralizer) + +## Why this project? +This repo is simply a Python port of https://github.com/blakeembrey/pluralize which has > 1.4m github usages and 3.5 million downloads per week when I evaluating different libraries. + +> This module uses a pre-defined list of rules, applied in order, to singularize or pluralize a given word. There are many cases where this is useful, such as any automation based on user input. For applications where the word(s) are known ahead of time, you can use a simple ternary (or function) which would be a much lighter alternative. + +I have compared the following alternatives and found https://github.com/blakeembrey/pluralize is the best one for me (most accurate), so ported it into the Python world. +- TextBlob: https://github.com/sloria/TextBlob +- inflect: https://github.com/jazzband/inflect +- NLTK Wordnet: https://www.nltk.org/howto/wordnet.html + + +## Installation +```bash +pip install pluralizer +``` + +## Usage +```python +from pluralizer import Pluralizer + +pluralizer = Pluralizer() + +assert pluralizer.pluralize('apple', 1, False) == 'apple' +assert pluralizer.pluralize('apple', 1, True) == '1 apple' +assert pluralizer.pluralize('apple', 2, False) == 'apples' +assert pluralizer.pluralize('apple', 2, True) == '2 apples' + +assert pluralizer.plural('apple') == 'apples' +assert pluralizer.singular('apples') == 'apple' + +assert pluralizer.isPlural('apples') == True +assert pluralizer.isPlural('apple') == False +assert pluralizer.isSingular('apples') == False +assert pluralizer.isSingular('apple') == True +``` + +## License +MIT + +All credits to https://github.com/blakeembrey/pluralize. + + + + +%prep +%autosetup -n pluralizer-1.2.0 + +%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-pluralizer -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 10 2023 Python_Bot <Python_Bot@openeuler.org> - 1.2.0-1 +- Package Spec generated @@ -0,0 +1 @@ +e3d7ec9784a66f31bb983d04a504993c pluralizer-1.2.0.tar.gz |
