Download the PHP package jayeshmepani/lipimala without Composer
On this page you can find all versions of the php package jayeshmepani/lipimala. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jayeshmepani/lipimala
More information about jayeshmepani/lipimala
Files in jayeshmepani/lipimala
Package lipimala
Short Description Exact round-trip IAST and extended Indic transliteration for Devanagari, Gujarati, plain English, canonical reverse conversion, and direct Gujarati/Devanagari conversion.
License MIT
Homepage https://github.com/jayeshmepani/indic-script-converter
Informations about the package lipimala
lipimala — Indic Script Converter (PHP)
A PHP 8.3+ port of the Indic-script conversion library (lipimala). It preserves identical conversion tables, profile defaults, contextual rules, Vedic handling, canonical reverse conversion, exact round-trip result envelope, and checksummed exact-source metadata format. The direct Gujarati ↔ Devanagari converter is included as well.
Package link on Packagist: packagist.org/packages/jayeshmepani/lipimala
Runtime
- PHP 8.3 or newer
declare(strict_types=1)throughout- no runtime package dependencies
- no
intl/mbstringrequirement - bundled Unicode 17.0.0 canonical normalization and mark data
The source project uses extendedIndic as the default forward profile, and this PHP port keeps that default.
Included conversions
- Latin/IAST + extended Indic → Devanagari
- Latin/IAST + extended Indic → Gujarati
- Latin/IAST → plain English
- explicit Hunterian view
- Devanagari → canonical IAST
- Gujarati → canonical IAST
- Devanagari → Gujarati
- Gujarati → Devanagari
- metadata-backed exact source recovery
- exact round-trip JSON envelope serialization
Installation
Via Composer (recommended)
Manual (no Composer)
Requirements
- PHP 8.3 or newer
- No runtime dependencies — no
intl, nombstring
Basic API
Bulk Array Transliteration
Forward profiles
The default is extendedIndic:
The forward script APIs expose the same policy families as the source implementation:
strictIastiso15919CoreextendedIndic- unknown Latin handling
- digit conversion/preservation
- punctuation preservation/Indic danda
- OM letter/sign policy
- ambiguous
ḷhandling - ASCII long-vowel aliases
sh,x,wcompatibility switches- Vedic accent preservation
- whitespace collapse
- exact-source metadata embedding
Exact Latin-key recovery
Visible Brahmic output is necessarily many-to-one. Case, source normalization, aliases, and equivalent extended spellings can collapse to the same visible script. Exact recovery therefore uses the same invisible Unicode-Tag trailer as the Dart/Python/JavaScript implementations.
Gujarati uses IastToGujaratiOptions and toExactIastFromGujarati().
The metadata encodes the exact UTF-16LE source unit sequence, stores independent FNV-1a checksums for source and visible rendering, and rejects corrupted/tampered trailers. The PHP implementation is byte-for-byte compatible with the supplied cross-language metadata vector, including supplementary code points and isolated UTF-16 surrogate units.
Canonical reverse vs exact reverse
Canonical reverse cannot infer which Latin alias/case/normalization originally produced a visible script string.
Direct Gujarati ↔ Devanagari
Canonical visible conversion:
The two scripts have unequal Unicode repertoires, so visible conversion is non-injective. Exact script-source recovery uses a typed source marker inside the same metadata trailer:
The opposite direction uses toCanonicalDevanagariFromGujarati() and toExactGujaratiFromDevanagari().
Direct conversion also exposes source-digit preservation, target-digit conversion, unknown-character preservation/strict error, normalization, whitespace collapse, and exact round-trip-envelope APIs.
Vedic ordering
The forward implementation keeps the source library's Unicode-recommended Brahmic storage order: vowel/matra, then bindu/visarga, then svara. Forms such as वसोः॑ and जुष्टं॑ therefore remain unchanged from the verified Dart behavior.
Exact Round-Trip envelope
The envelope schema is exact round-trip-indic-transliteration/1 and includes original code-point integrity checking.
CLI output generators
Run from the PHP project root:
All runners JSON-escape each source/result string so quotes and embedded newlines cannot corrupt record boundaries.
Run every output generator:
Verification
The bundled regression suite verifies the five original 497-case directions, both 497-case direct script directions, all 22 Vedic fixtures, profile/option behavior, exact metadata, tamper rejection, exact round-trip JSON envelopes, and exact direct-script corpus recovery.
See PORT_VERIFICATION.md for the executed result and parity counts.