Skip to content

Releases

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 03 Nov 10:01
7a28d5e

New: transitivity, the passive, and the مدغم shape

  • mazini.lexicon keeps each listed verb's ل / م / ك mark from the tables, which used to be dropped:
    • transitivity(root, wazn) → "intransitive" | "transitive" | "both" | None
    • lexicon_passive(root, wazn) → the passive that follows from it: "pass" (transitive: ضُرِبْتُ), "ipass" (intransitive: جُلِسَ عَلَيْهِ only), "nopass" (patterns that never take one: فعُل, انفعل, افعلّ…), or None if not listed.
  • conjugate's passive argument also takes "pass", "ipass" or "nopass"; anything else raises MaziniError("bad_option"). The engine's guess from the pattern is often wrong for form I (it gives جلس a full passive, *جُلِسْتُ); pass lexicon_passive(...) instead.
  • reducible(root, wazn) says whether Arabic has the assimilated (مدغم) shape that reduced=True produces: تفعّل / تفاعل with ف in ت ث د ذ ز س ش ص ض ط ظ, انفعل with م, اتّخذ / اتّزر / اتّحد, اسطاع, افعنلل with ل1 و or ي. conjugate still 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.0

PyPI: https://pypi.org/project/mazini/0.3.0/
Full Changelog: v0.2.2...v0.3.0

v0.2.2

Choose a tag to compare

@forzagreen forzagreen released this 19 Oct 16:42
c399e13

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.2

PyPI: https://pypi.org/project/mazini/0.2.2/
Full Changelog: v0.2.1...v0.2.2

v0.2.1

Choose a tag to compare

@forzagreen forzagreen released this 19 Oct 16:03
2788fb2

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.1

PyPI: https://pypi.org/project/mazini/0.2.1/
Full Changelog: v0.2.0...v0.2.1

v0.2.0

Choose a tag to compare

@forzagreen forzagreen released this 19 Oct 14:43
33f1950

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 for conjugate. Bad input raises MaziniError with 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.py from a dataset checkout (#1).

Engine: synced to upstream checkpoint 7

Mirrors ar-verb.lua:

  • GEMINATE_ITBAA_ROOTS += شرر, لبب; SOUND_ROOTS += VIII:زوج.
  • SOUND_FORM_I_UU_ROOTS becomes SOUND_FORM_I_ROOTS, keyed root: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.0

PyPI: https://pypi.org/project/mazini/0.2.0/
Full Changelog: v0.1.0...v0.2.0

v0.1.0

Choose a tag to compare

@forzagreen forzagreen released this 12 Sep 08:09

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/