Repository navigation
v0.1.0
First release of mazini, an Arabic verb conjugator for JavaScript / TypeScript.
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-TypeScript port of Arabic Wiktionary's conjugation engine, وحدة:ar-verb (descended from Module:ar-verb). A Python port with the same API and tests: mazini.
Highlights
conjugate(root, wazn, { vowels, reduced, passive }): patterns by Arabic name ("فعَل يفعُل") or form code ("I"…"X"), roots writtenكتب,ك ت بorك_ت_ب.WAZNS,SLOTS,classifyTriliteralVerb,loose, andMaziniErrorwith stable.codes.- Pure JS, zero dependencies, no data files. ESM + CommonJS, typed, Node 18–24 and every browser, ~90 KB.
- Live demo: forzagreen.github.io/mazini-js. Conjugate any verb, and run the 15,549 book assertions in the browser.
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
npm install mazini@0.1.0Licence: CC BY 4.0.
npm: https://www.npmjs.com/package/mazini/v/0.1.0
The npm package was published from 6f1549c, a little before this tag. The library code (
src/) is identical. The tag only adds the licence (LICENSEand thelicensefield inpackage.json), a README note, a publish-workflow tweak and an analytics tag on the demo.