Hi all,
I've released unimorph-rs, a command-line tool and Python library for working with UniMorph morphological data. It provides fast local access to UniMorph datasets for lookups, analysis, and export.
CLI Installation
# Homebrew (macOS/Linux)
brew install joshrotenberg/brew/unimorph
# Shell installer
curl --proto '=https' --tlsv1.2 -LsSf
https://github.com/joshrotenberg/unimorph-rs/releases/latest/download/unimorph-installer.sh | sh
# Cargo
cargo install unimorph
Pre-built binaries for macOS (Intel/Apple Silicon), Linux (x64/ARM64), and Windows are also available on the releases page:
https://github.com/joshrotenberg/unimorph-rs/releases/latestCLI examples
# Download a dataset
unimorph download spa
# Look up all forms of a lemma
unimorph inflect spa hablar
# Reverse lookup - find lemmas for a surface form
unimorph analyze spa hablo
# Search with filters
unimorph search spa --lemma "habl*" --contains V,IND
# Export to JSON Lines
unimorph export spa -f jsonl -o spanish.jsonl
Python library
pip install unimorph-rs
from unimorph import Store, download
download("spa")
store = Store()
for entry in store.inflect("spa", "hablar"):
print(f"{entry.form}: {entry.features}")
Data is stored locally in SQLite for fast queries. The CLI also includes dataset statistics, shell completions, and colored output.
Links
- GitHub:
https://github.com/joshrotenberg/unimorph-rs- Documentation:
https://joshrotenberg.github.io/unimorph-rs/- PyPI:
https://pypi.org/project/unimorph-rs/Feedback and contributions welcome.
Thanks,
Josh