Skip to content

v0.2.0

Choose a tag to compare

@forzagreen forzagreen released this 19 Oct 14:43
05d964d

New: mazini/lexicon, "is it a verb?"

The engine conjugates any root on any pattern, and most such combinations are not words. The new mazini/lexicon entry point 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.

import { isAttested, attestedWazns } from "mazini/lexicon";
  • API: lexiconRoots(), attestedWazns(root), isAttested(root, wazn), LEXICON_INFO. Roots and patterns are written as for conjugate. Bad input throws MaziniError with the same codes.
  • It is a separate package export (dist/lexicon.js, 46 KB), so importing mazini alone bundles none of it, and it never restricts conjugate. The data (one fixed-width record per root: radicals in Buckwalter plus a bitmask of attested patterns) is decoded on first use.
  • Regenerate with tools/gen_lexicon.py from a dataset checkout (#1).

Demo: attested verbs by default

  • A checkbox «الأفعال الواردة في المعجم فقط», on by default. With it on, the pattern menu greys out the patterns the lexicon doesn't list for the typed root (and moves the selection to a listed one), and the root field suggests the 7,626 roots. An unlisted root or verb shows a notice with a button to lift the restriction.
  • Listed patterns are ticked in the menu, and the facts line says وارد / غير وارد.
  • The choice is remembered. A link shared from the unrestricted page carries all=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 (and the demo's self-test) 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

npm install mazini@0.2.0

npm: https://www.npmjs.com/package/mazini/v/0.2.0
Full Changelog: v0.1.0...v0.2.0