%global _empty_manifest_terminate_build 0
Name: python-yargy
Version: 0.15.1
Release: 1
Summary: Rule-based facts extraction for Russian language
License: MIT
URL: https://github.com/natasha/yargy
Source0: https://mirrors.nju.edu.cn/pypi/web/packages/04/05/aa9af6c2b4e8cf4f96ceb04a7d3bc9224837959a643f92403c915cb6ce50/yargy-0.15.1.tar.gz
BuildArch: noarch
Requires: python3-pymorphy2
%description

Yargy uses rules and dictionaries to extract structured information from Russian texts. Yargy is similar to Tomita parser.
## Install
Yargy supports Python 3.7+, PyPy 3, depends only on Pymorphy2.
```bash
$ pip install yargy
```
## Usage
```python
from yargy import Parser, rule, and_, not_
from yargy.interpretation import fact
from yargy.predicates import gram
from yargy.relations import gnc_relation
from yargy.pipelines import morph_pipeline
Name = fact(
'Name',
['first', 'last'],
)
Person = fact(
'Person',
['position', 'name']
)
LAST = and_(
gram('Surn'),
not_(gram('Abbr')),
)
FIRST = and_(
gram('Name'),
not_(gram('Abbr')),
)
POSITION = morph_pipeline([
'управляющий директор',
'вице-мэр'
])
gnc = gnc_relation()
NAME = rule(
FIRST.interpretation(
Name.first
).match(gnc),
LAST.interpretation(
Name.last
).match(gnc)
).interpretation(
Name
)
PERSON = rule(
POSITION.interpretation(
Person.position
).match(gnc),
NAME.interpretation(
Person.name
)
).interpretation(
Person
)
parser = Parser(PERSON)
match = parser.match('управляющий директор Иван Ульянов')
print(match)
Person(
position='управляющий директор',
name=Name(
first='Иван',
last='Ульянов'
)
)
```
## Documentation
All materials are in Russian:
* Overview
* Video from workshop
* Getting started
* Reference
* Cookbook
* Examples
* Code snippets
## Support
- Chat — https://t.me/natural_language_processing
- Issues — https://github.com/natasha/yargy/issues
- Commercial support — https://lab.alexkuk.ru
## Development
Dev env
```bash
pyenv virtualenv 3.11.0 natasha-yargy
pyenv activate natasha-yargy
pip install -r requirements/dev.txt
pip install -e .
pyenv virtualenv-delete natasha-yargy
```
Test + lint
```bash
make test
```
Update docs
```bash
make exec-docs
# Manually check git diff docs/, commit
```
Release
```bash
# Update setup.py version
git commit -am 'Up version'
git tag v0.15.1
git push
git push --tags
# Github Action builds dist and publishes to PyPi
```
%package -n python3-yargy
Summary: Rule-based facts extraction for Russian language
Provides: python-yargy
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-yargy

Yargy uses rules and dictionaries to extract structured information from Russian texts. Yargy is similar to Tomita parser.
## Install
Yargy supports Python 3.7+, PyPy 3, depends only on Pymorphy2.
```bash
$ pip install yargy
```
## Usage
```python
from yargy import Parser, rule, and_, not_
from yargy.interpretation import fact
from yargy.predicates import gram
from yargy.relations import gnc_relation
from yargy.pipelines import morph_pipeline
Name = fact(
'Name',
['first', 'last'],
)
Person = fact(
'Person',
['position', 'name']
)
LAST = and_(
gram('Surn'),
not_(gram('Abbr')),
)
FIRST = and_(
gram('Name'),
not_(gram('Abbr')),
)
POSITION = morph_pipeline([
'управляющий директор',
'вице-мэр'
])
gnc = gnc_relation()
NAME = rule(
FIRST.interpretation(
Name.first
).match(gnc),
LAST.interpretation(
Name.last
).match(gnc)
).interpretation(
Name
)
PERSON = rule(
POSITION.interpretation(
Person.position
).match(gnc),
NAME.interpretation(
Person.name
)
).interpretation(
Person
)
parser = Parser(PERSON)
match = parser.match('управляющий директор Иван Ульянов')
print(match)
Person(
position='управляющий директор',
name=Name(
first='Иван',
last='Ульянов'
)
)
```
## Documentation
All materials are in Russian:
* Overview
* Video from workshop
* Getting started
* Reference
* Cookbook
* Examples
* Code snippets
## Support
- Chat — https://t.me/natural_language_processing
- Issues — https://github.com/natasha/yargy/issues
- Commercial support — https://lab.alexkuk.ru
## Development
Dev env
```bash
pyenv virtualenv 3.11.0 natasha-yargy
pyenv activate natasha-yargy
pip install -r requirements/dev.txt
pip install -e .
pyenv virtualenv-delete natasha-yargy
```
Test + lint
```bash
make test
```
Update docs
```bash
make exec-docs
# Manually check git diff docs/, commit
```
Release
```bash
# Update setup.py version
git commit -am 'Up version'
git tag v0.15.1
git push
git push --tags
# Github Action builds dist and publishes to PyPi
```
%package help
Summary: Development documents and examples for yargy
Provides: python3-yargy-doc
%description help

Yargy uses rules and dictionaries to extract structured information from Russian texts. Yargy is similar to Tomita parser.
## Install
Yargy supports Python 3.7+, PyPy 3, depends only on Pymorphy2.
```bash
$ pip install yargy
```
## Usage
```python
from yargy import Parser, rule, and_, not_
from yargy.interpretation import fact
from yargy.predicates import gram
from yargy.relations import gnc_relation
from yargy.pipelines import morph_pipeline
Name = fact(
'Name',
['first', 'last'],
)
Person = fact(
'Person',
['position', 'name']
)
LAST = and_(
gram('Surn'),
not_(gram('Abbr')),
)
FIRST = and_(
gram('Name'),
not_(gram('Abbr')),
)
POSITION = morph_pipeline([
'управляющий директор',
'вице-мэр'
])
gnc = gnc_relation()
NAME = rule(
FIRST.interpretation(
Name.first
).match(gnc),
LAST.interpretation(
Name.last
).match(gnc)
).interpretation(
Name
)
PERSON = rule(
POSITION.interpretation(
Person.position
).match(gnc),
NAME.interpretation(
Person.name
)
).interpretation(
Person
)
parser = Parser(PERSON)
match = parser.match('управляющий директор Иван Ульянов')
print(match)
Person(
position='управляющий директор',
name=Name(
first='Иван',
last='Ульянов'
)
)
```
## Documentation
All materials are in Russian:
* Overview
* Video from workshop
* Getting started
* Reference
* Cookbook
* Examples
* Code snippets
## Support
- Chat — https://t.me/natural_language_processing
- Issues — https://github.com/natasha/yargy/issues
- Commercial support — https://lab.alexkuk.ru
## Development
Dev env
```bash
pyenv virtualenv 3.11.0 natasha-yargy
pyenv activate natasha-yargy
pip install -r requirements/dev.txt
pip install -e .
pyenv virtualenv-delete natasha-yargy
```
Test + lint
```bash
make test
```
Update docs
```bash
make exec-docs
# Manually check git diff docs/, commit
```
Release
```bash
# Update setup.py version
git commit -am 'Up version'
git tag v0.15.1
git push
git push --tags
# Github Action builds dist and publishes to PyPi
```
%prep
%autosetup -n yargy-0.15.1
%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-yargy -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Fri May 05 2023 Python_Bot - 0.15.1-1
- Package Spec generated