| Crates.io | unimorph-cli |
| lib.rs | unimorph-cli |
| version | 0.1.3 |
| created_at | 2026-01-06 03:26:28.970061+00 |
| updated_at | 2026-01-06 22:28:21.999087+00 |
| description | Command-line interface for UniMorph morphological data |
| homepage | |
| repository | https://github.com/joshrotenberg/unimorph-rs |
| max_upload_size | |
| id | 2025121 |
| size | 198,039 |
A Rust toolkit for working with UniMorph morphological data.
UniMorph provides morphological paradigm data for 169+ languages in a unified annotation format. Each entry is a triple of lemma, inflected form, and morphological features:
lemma form features
hablar hablo V;IND;PRS;1;SG
hablar hablado V;V.PTCP;PST;MASC;SG
ser soy V;IND;PRS;1;SG
brew tap joshrotenberg/brew
brew install unimorph
cargo install unimorph-cli
docker pull ghcr.io/joshrotenberg/unimorph-rs:latest
# Run with persistent data cache
docker run -v ~/.cache/unimorph:/data ghcr.io/joshrotenberg/unimorph-rs download spa
docker run -v ~/.cache/unimorph:/data ghcr.io/joshrotenberg/unimorph-rs inflect spa hablar
git clone https://github.com/joshrotenberg/unimorph-rs
cd unimorph-rs
cargo install --path crates/unimorph-cli
# Download Spanish dataset
unimorph download spa
# Look up all forms of a verb
unimorph inflect spa hablar
# Analyze a surface form (reverse lookup)
unimorph analyze spa hablo
# Search with filters
unimorph search spa --lemma "habl*" --contains V,IND
# Dataset statistics
unimorph stats spa
# Export to JSON Lines
unimorph export spa -F jsonl -o spanish.jsonl
use unimorph_core::{Store, Repository, LangCode};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Download dataset if needed
let repo = Repository::new()?;
let lang: LangCode = "spa".parse()?;
repo.ensure_dataset(&lang).await?;
// Query the data
let store = repo.store()?;
// Get all forms of a lemma
for entry in store.inflect(&lang, "hablar")? {
println!("{} -> {} [{}]", entry.lemma, entry.form, entry.features);
}
// Reverse lookup: find lemmas for a surface form
for entry in store.analyze(&lang, "hablo")? {
println!("{} <- {} [{}]", entry.form, entry.lemma, entry.features);
}
Ok(())
}
Full documentation is available at joshrotenberg.github.io/unimorph-rs, including:
pip install unimorph-rs
from unimorph import Store, download
download("ita")
store = Store()
for entry in store.inflect("ita", "parlare"):
print(f"{entry.form}: {entry.features}")
See the Python documentation for more details.
unimorph-rs/
├── crates/
│ ├── unimorph-core/ # Core library: types, SQLite store, repository
│ ├── unimorph-cli/ # Command-line interface
│ └── unimorph-python/ # Python bindings (PyO3)
└── docs/ # mdBook documentation
Apache-2.0