Experimental morph-rs bindings for Python.
Demonstration: test.ipynb
Current workflow:
- Install rust, python (3.8 shoud be supported, tested on 3.10)
- Create a virtual environment:
python -m venv .venv - Activate the virtual environment:
source .venv/bin/activate - Install dependencies:
pip install -r dev_requirements.txt - Build and install morphrs-py:
maturin develop - Download the dictionary from morph-rs releases:
wget --quiet https://github.com/kribrum-os/morph-rs/releases/download/v0.2.0/dict.zip && unzip dict.zip -d dictNow you can use morphrs_py from python:
from morphrs_py import MorphAnalyzer
analyzer = MorphAnalyzer.open("dict/")
steel = morph_analyzer.parse_word("стали")
print(steel)Also, you can run the test.ipynb using jupyter notebook:
jupyter notebook test.ipynbThe code of this project is licensed under the Apache License 2.0.
The code of morph-rs is licensed under the Kribrum-NC (Apache License 2.0 based) license.