Skip to content

v0.1.0

Choose a tag to compare

@forzagreen forzagreen released this 12 Sep 08:09
· 18 commits to main since this release

First release of mazini, an Arabic verb conjugator for Python.

Give it a root and a pattern (وزن) and it returns every form of the verb: past, indicative, subjunctive, jussive and imperative, active and passive, in all thirteen persons, plus the participles and the مصدر. That is 119 slots, fully vocalised, with the attested alternative spellings.

It is a pure-Python port of Arabic Wiktionary's conjugation engine, وحدة:ar-verb (descended from Module:ar-verb), ported file for file from mazini-js.

Highlights

  • conjugate(root, wazn, *, vowels=, reduced=, passive=): patterns by Arabic name ("فعَل يفعُل") or form code ("I"…"X"), roots written كتب, ك ت ب or ك_ت_ب.
  • WAZNS, SLOTS, classify_triliteral_verb, loose, and MaziniError with stable .codes (bad_root, unknown_wazn, …).
  • CLI: mazini كتب "فعَل يفعُل" prints the table.
  • Pure Python, zero dependencies, no data files, typed, Python 3.11+.

Verification

  • Against the book: all 15,549 printed forms of the 462 paradigms in أنطوان الدحداح, معجم تصريف الأفعال العربية (ar-conjugation dataset) are among the generated forms.
  • Against the Lua module: byte-identical output on 7,851 inputs (741,188 forms, footnotes and metadata fields, the same 201 rejected inputs), on every process_hamza call (54,202) and on the loose() parity set (51,041 records).

Install

pip install mazini==0.1.0

Licence: CC BY 4.0.

PyPI: https://pypi.org/project/mazini/0.1.0/