Skip to content

v0.3.0

Latest

Choose a tag to compare

@github-actions github-actions released this 03 Nov 10:01
1b9297a

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" | null
    • lexiconPassive(root, wazn) → the passive that follows from it: "pass" (transitive: ضُرِبْتُ), "ipass" (intransitive: جُلِسَ عَلَيْهِ only), "nopass" (patterns that never take one: فعُل, انفعل, افعلّ…), or null if not listed.
  • conjugate's passive option also takes "pass", "ipass" or "nopass"; anything else throws MaziniError("bad_option"). The engine's guess from the pattern is often wrong for form I (it gives جلس a full passive, *جُلِسْتُ); pass lexiconPassive(...) 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 options is unchanged: byte-identical to Module:ar-verb on the 7,884 golden inputs, and all 16,593 book forms still match. The lexicon entry point grows from 46 KB to 55 KB (#17).

Demo

  • The passive comes from the lexicon, with the verb's transitivity shown; a فعل لازم gets no passive unless the reader asks for the impersonal one (#17, #19).
  • Options are offered only when they change the verb, labelled with the verb's own forms («الصيغة المُدغَمة: اِسَّمَّعَ بدل تَسَمَّعَ») (#16).
  • Compact mobile layout (#18).

The Python port is released alongside with the same API: mazini 0.3.0.

Install

npm install mazini@0.3.0

npm: https://www.npmjs.com/package/mazini/v/0.3.0
Full Changelog: v0.2.2...v0.3.0