Repository navigation
v0.1.0
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, andMaziniErrorwith 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-conjugationdataset) 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_hamzacall (54,202) and on theloose()parity set (51,041 records).
Install
pip install mazini==0.1.0Licence: CC BY 4.0.