Download the PHP package helturkey/arabic-prosody without Composer
On this page you can find all versions of the php package helturkey/arabic-prosody. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download helturkey/arabic-prosody
More information about helturkey/arabic-prosody
Files in helturkey/arabic-prosody
Package arabic-prosody
Short Description Dependency-free Arabic prosody (ʿarūḍ): vocalized text to binary scansion, rule-based meter detection for hemistichs, verses, whole poems and free verse, with foot-by-foot explanations.
License MIT
Informations about the package arabic-prosody
PHP Arud
Dependency-free Arabic prosody (ʿarūḍ) for PHP 8.1+: from vocalized Arabic text to the binary scansion, then rule-based meter detection for a hemistich, a verse, a whole poem, or a free-verse line, with foot-by-foot explanations. العربية
Status: 1.0.0-rc.1. Engineering is production-grade (typed, validated, tested, bounded). The linguistic grammar is a faithful encoding of the textbook rules but has not been reviewed by a prosody scholar, and the regression corpus is small (15 verses, 6 meters). Read RELEASE_STATUS.md before relying on it for anything beyond assistance.
Install
Use
Every candidate carries key, label_ar (e.g. «أحذ الكامل»), match_type (exact | compatible | approximate), tier, modifications, ambiguous_with, tasri, and feet — one row per foot with its role (hashw/arud/darb), the rule applied (e.g. القبض) and a status (ok, broken, missing, extra_bits).
CLI
What it does well, and what it does not
- Input must be vocalized. Unvocalized text yields
?in the pattern,compatiblematches at best, and neverhighconfidence. It does not diacritize; pair it with a diacritizer if needed. - Honest about ambiguity. Kamil with idmār is binary-identical to Rajaz; both are returned and flagged (
ambiguous_with) instead of silently picking one. - Position-aware grammar per meter (ḥashw / ʿarūḍ / ḍarb), with taṣrīʿ for opening verses.
- 31 forms: 16 classical meters with tamm, majzūʾ, mashṭūr, manhūk and mukhallaʿ al-basīṭ where attested. Forms marked
rarehave permissive, partially verified grammars and cap confidence atmedium. Names from the poetry encyclopedia that are not modelled (muwashshaḥ, dūbayt, mawāliyā …) are listed byMeterCatalog::extended()with the reason. - Not covered: qāfiya analysis, diacritization, non-Khalilian forms, tadwīr across hemistichs.
Quality gates
Performance (PHP 8.3, laptop-class CPU): ≈0.7 ms per verse when an exact parse exists; ≈5 ms with the bounded approximate fallback; a 500-verse poem in ≈0.4 s, ≈12 MB.
Security & limits
Inputs are validated (UTF-8, ≤ 2000 bytes per hemistich, ≤ 2000 verses, ≤ 2 MB total). The library itself does no eval, filesystem or network access. See SECURITY.md.
Source:
This package started as part of the core of the Arabic prosody analysis behind موسوعة الشعراء, then became open source to help Arabic poetry developers, researchers, and linguists.
License
MIT. See THIRD_PARTY_NOTICES.md.
All versions of arabic-prosody with dependencies
ext-json Version *
ext-pcre Version *