afify/egy-names

Egyptian names engine for PHP — generate, translate, split, correct, and annotate grounded patronymic chains. Offline.

v0.3.4 2026-08-30 14:25 UTC

This package is not auto-updated.

Last update: 2026-08-30 21:29:01 UTC


README

Egyptian names engine for PHP 8.1+. Same book as the other SDKs — 44,626 lemmas, offline.

A legal Egyptian name is a patronymic chain, not a first name and a last name. This package generates, translates, splits, and corrects those chains. Product page: afify.co/egy-names. Story: The Secret Code of Egyptian Names.

This is the engine. Packagist: afify/egy-names. For Faker fixtures, use afify/faker-egy-names.

Install

composer require afify/egy-names

Requires PHP 8.1+, ext-json, and ext-zlib. No Faker dependency.

Use

require 'vendor/autoload.php';

use Afify\EgyNames\EgyNames;

$en = new EgyNames();

$names = $en->generate(count: 2, gender: 'female', length: 4, family_name: true);
echo $names[0]->ar;
echo $names[0]->en;
print_r($names[0]->parts_ar);

echo $en->translate('محمد أحمد علي');          // Mohamed Ahmed Ali
echo $en->translate('Mohamed Ahmed Ali');     // محمد أحمد علي
print_r($en->split('محمدأحمدعليحسنالشناوي'));
echo $en->correct('احمد مصطفا');              // أحمد مصطفى
echo $en->tashkeel('محمد');

CamelCase aliases (tashkeelEg, detectGender, isValid, …) do the same work. Named arguments use snake_case so Python-shaped calls work.

$en->batch() (or $en->batch) maps translate, annotate, correct, split, detectGender, detectReligion, and tashkeel over arrays.

generate(seed: n) uses PHP Randomizer / Mt19937. Seeds are not aligned with Python.

License

MIT. Copyright (c) 2026 Afify by Abdullah Afify. An Afify open-source project. afify.co/egy-names