anderss0n / persiana
Persiana is a Persian text normalizer utility that support English for every day usage with texts.
Installs: 29
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/anderss0n/persiana
Requires
- php: >=7.0
Requires (Dev)
- php: >=7.1
- ext-mbstring: *
- phpunit/phpunit: ~5.7.10|~6.5|~7.0|~8.0|~9.0
This package is auto-updated.
Last update: 2025-10-29 03:10:32 UTC
README
Persiana
Persiana is a Persian text normalizer utility that support English for every day usage with texts.
Install
by Composer
composer require anderss0n/persiana
by Git
git clone git@github.com:MrAnderss0n/Persiana.git
How to use
Use the following class into your PHP code:
use Anderss0n\Persiana\Normalizer;
Simple example:
echo Normalizer::tidySpaces('test the new package.'); // OUTPUT: test the new package.
List of methods
| Static Methods | Description |
|---|---|
| tidySpaces | Convert sequence of spaces to single space and trim it. |
| dropBreakingLines | Drop breaking line to make sequence of text without new lines. |
| dropPersianPhonemes | Drop general Persian vowel phonemes. |
| normalizePersianNumbers | Convert Persian numbers to its English form. |
| normalizePersianLetters | Convert Arabic letters to Persian one. |
| normalizeEnglishLetters | Convert Latin letters to English one. |
| normalizeWhiteSpaces | Convert all type of spaces to standard one. |
| fetchValidLetters | Fetch only Persian and English letters then tidy spaces. |
| fetchInvalidCharacters | Fetch all thing instead of Persian and English letters. |
| normalize | Full normalize uses this class functionality to prevent repeating usage. |
| slug | Make a slug for url usage. |