PHPackages                             gildrd/name-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. gildrd/name-generator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

gildrd/name-generator
=====================

A name generator using markov chain

v1.0(4y ago)019PHPPHP &gt;=7.4

Since Oct 7Pushed 4y agoCompare

[ Source](https://github.com/gildrd/name-generator)[ Packagist](https://packagist.org/packages/gildrd/name-generator)[ RSS](/packages/gildrd-name-generator/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/99ec53d82291a5703f8472ab536c23d4da9c7456ff1807401b81aee0b42dc489/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f67696c6472642f6e616d652d67656e657261746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/gildrd/name-generator/?branch=master)[![Build Status](https://camo.githubusercontent.com/b1ca57cfe5376515d71038345ec616cd8a712d9e418340d0989681a6caa64ecf/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f67696c6472642f6e616d652d67656e657261746f722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/gildrd/name-generator/build-status/master)[![Code Intelligence Status](https://camo.githubusercontent.com/3bb36cf2a717a786170cc175dbe4d8f1b4db5be7451e145ffe1c64d0021382c5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f67696c6472642f6e616d652d67656e657261746f722f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572)](https://scrutinizer-ci.com/code-intelligence)

name-generator
==============

[](#name-generator)

Generate names following Markov algorithm. This way, you will have names that looks "realistic" and not just a random succession of letters.

The way names are generated is only statistic. The more names you have in a list, the more "realitic" the result wille be. Of course, some strange results can occur.

How markov chains work
======================

[](#how-markov-chains-work)

Each names are analysed and an array is generated, indicating what are the probability a letter is followed by another specific letter.

Per exemple, if you have two words 'aa' and 'ab' :

- First letter will be 'a'
- 'a' will be followed by another 'a', a 'b', or will be the last letter with 33% chance each.
- 'b' will be the last letter

\#How to install Use composer to simply add this package to your project:

```
composer require gildrd/name-generator

```

\#How to use There are several ways to use this package:

By using built-in names lists
-----------------------------

[](#by-using-built-in-names-lists)

This package comes with some names lists: elves, dwarves and for Warhammer 40K. Others will be added later.

You can use one or more list as references to generate new names:

```
$nameGenerator = new NameGenerator(Type::FEMALE_40K_HIGHER_GOTHIC, Type::FEMALE_40K_LOWER_GOTHIC);
$name = $nameGenerator->generate();

```

By using your own list
----------------------

[](#by-using-your-own-list)

If you don't like the lists included, you can work with your own lists. These can be PHP array or JSON.

### Array list

[](#array-list)

```
$nameGenerator = new NameGenerator();
$nameGenerator->analyseFromArray(['Riri', 'Fifi', 'Loulou', 'Picsou']);
$name = $nameGenerator->generate();

```

### JSON list

[](#json-list)

```
$nameGenerator = new NameGenerator();
$nameGenerator->analyseFromJson('["Riri", "Fifi", "Loulou", "Picsou"]');
$name = $nameGenerator->generate();

```

Setting up some parameters
--------------------------

[](#setting-up-some-parameters)

There are some parameters you can set:

- mininimum length: by default, the shortest name of your list
- maximum length: by default, the longest name of your list
- can a letter be three times in a row: by default false to avoid names such as 'aellla'
- can be a name without vowels: by default false to avoid names such as 'rvrk'

To configure your parameters, create a new Parameter instance:

```
$nameGenerator = new NameGenerator(Type::MALE_40K_ARCHAIC);
$parameter = new Parameter();
$parameter->setLetterInTriple(false)
    ->setMinLength(5)
    ->setMaxLength(9)
    ->setNoVowelsInName(false);
$nameGenerator->setParameter($parameter);
$name = $nameGenerator->generate();

```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~12 days

Total

4

Last Release

1692d ago

Major Versions

v0.3-beta → v1.02021-11-14

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/26569095?v=4)[GillesDrD](/maintainers/gildrd)[@gildrd](https://github.com/gildrd)

---

Top Contributors

[![gildrd](https://avatars.githubusercontent.com/u/26569095?v=4)](https://github.com/gildrd "gildrd (14 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gildrd-name-generator/health.svg)

```
[![Health](https://phpackages.com/badges/gildrd-name-generator/health.svg)](https://phpackages.com/packages/gildrd-name-generator)
```

###  Alternatives

[tholu/php-cidr-match

CIDRmatch is a library to match an IP to an IP range in CIDR notation (IPv4 and IPv6).

35228.9k](/packages/tholu-php-cidr-match)[mehrab-wj/tiktoken-php

a clone of python tiktoken but for PHP! fast BPE tokeniser for use with OpenAI's models.

17114.9k4](/packages/mehrab-wj-tiktoken-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
