Repository navigation
Releases
v0.3.0
New: transitivity, the passive, and the مدغم shape
mazini.lexiconkeeps each listed verb's ل / م / ك mark from the tables, which used to be dropped:transitivity(root, wazn)→"intransitive" | "transitive" | "both" | Nonelexicon_passive(root, wazn)→ the passive that follows from it:"pass"(transitive: ضُرِبْتُ),"ipass"(intransitive: جُلِسَ عَلَيْهِ only),"nopass"(patterns that never take one: فعُل, انفعل, افعلّ…), orNoneif not listed.
conjugate'spassiveargument also takes"pass","ipass"or"nopass"; anything else raisesMaziniError("bad_option"). The engine's guess from the pattern is often wrong for form I (it gives جلس a full passive, *جُلِسْتُ); passlexicon_passive(...)instead.reducible(root, wazn)says whether Arabic has the assimilated (مدغم) shape thatreduced=Trueproduces: تفعّل / تفاعل with ف in ت ث د ذ ز س ش ص ض ط ظ, انفعل with م, اتّخذ / اتّزر / اتّحد, اسطاع, افعنلل with ل1 و or ي.conjugatestill applies it to any root, as the Lua module does (*اِكَّتَّبَ).
conjugate's output with default arguments is unchanged, and the golden and book suites still pass (#6). Same API and the same lexicon data as mazini-js 0.3.0.
Install
pip install mazini==0.3.0PyPI: https://pypi.org/project/mazini/0.3.0/
Full Changelog: v0.2.2...v0.3.0
v0.2.2
Metadata-only release: no library changes since 0.2.1.
Changes
- The package description now says the engine is verified against 16,593 printed forms (495 paradigms), the count since the upstream checkpoint-7 sync in 0.2.0. It still said 15,549 (#5).
Install
pip install mazini==0.2.2PyPI: https://pypi.org/project/mazini/0.2.2/
Full Changelog: v0.2.1...v0.2.2
v0.2.1
Maintenance release: no library changes since 0.2.0.
0.2.0 was uploaded to PyPI by a manual workflow run before its GitHub Release existed. 0.2.1 is published from this release by the publish workflow, so the tag, the release and the PyPI files all come from the same commit.
Changes
- Publish workflow:
uv publish --check-url https://pypi.org/simple/skips files already on PyPI, so creating a release for a version that was already uploaded no longer fails (#3). - Version bump (#4).
Install
pip install mazini==0.2.1PyPI: https://pypi.org/project/mazini/0.2.1/
Full Changelog: v0.2.0...v0.2.1
v0.2.0
New: mazini.lexicon, "is it a verb?"
The engine conjugates any root on any pattern, and most such combinations are not words. mazini.lexicon says which ones are attested, using the four root × pattern tables of m-bakni/arabic-morphology (جداول إحصاء الأفعال العربية, CC BY 4.0): 24,188 verbs over 7,626 roots.
- API:
lexicon_roots(),attested_wazns(root),is_attested(root, wazn),LEXICON_INFO. Roots and patterns are written as forconjugate. Bad input raisesMaziniErrorwith the same codes. - The data (44 KB, one fixed-width record per root: radicals in Buckwalter plus a bitmask of attested patterns) is decoded on first use. Nothing else in the package imports it, and it never restricts
conjugate. - CLI:
mazini كتب(root alone) lists the root's attested patterns with their form codes. The conjugation table now says وارد / غير وارد. - Regenerate with
tools/gen_lexicon.pyfrom a dataset checkout (#1).
Engine: synced to upstream checkpoint 7
Mirrors ar-verb.lua:
GEMINATE_ITBAA_ROOTS+= شرر, لبب;SOUND_ROOTS+= VIII:زوج.SOUND_FORM_I_UU_ROOTSbecomesSOUND_FORM_I_ROOTS, keyedroot:vowels(هيء:uu, أوب:ia).- New
FORM_VIII_UNASSIMILATED_W_ROOTS(وشي: اِيتَشَى / يَوْتَشِي).
Fixtures regenerated from upstream: the book suite now covers 495 paradigms / 16,593 forms (was 462 / 15,549), all matched. Golden parity: 7,884 inputs / 744,356 variants. Hamza: 55,340. loose: 51,997.
Install
pip install mazini==0.2.0PyPI: https://pypi.org/project/mazini/0.2.0/
Full Changelog: v0.1.0...v0.2.0
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.