Skip to content

v0.1.0

Choose a tag to compare

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

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, and MaziniError with 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-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

npm install mazini@0.1.0

Licence: 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 (LICENSE and the license field in package.json), a README note, a publish-workflow tweak and an analytics tag on the demo.