PHPackages                             wapmorgan/morphos - 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. wapmorgan/morphos

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

wapmorgan/morphos
=================

A morphological solution for Russian and English language written completely in PHP. Provides classes to inflect personal names, geographical names, decline and pluralize nouns, generate cardinal and ordinal numerals, spell out money amounts and time.

3.2.30(10mo ago)8351.3M—1.1%113[11 issues](https://github.com/wapmorgan/Morphos/issues)[1 PRs](https://github.com/wapmorgan/Morphos/pulls)7MITPHPPHP &gt;=5.4.0CI failing

Since Nov 16Pushed 7mo ago36 watchersCompare

[ Source](https://github.com/wapmorgan/Morphos)[ Packagist](https://packagist.org/packages/wapmorgan/morphos)[ Docs](http://morphos.io)[ RSS](/packages/wapmorgan-morphos/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (66)Used By (7)

Morphos
=======

[](#morphos)

A morphological solution for Russian and English language written completely in PHP and delivered as a PHP library or docker image to integrate in non-PHP stack.

[![Latest Stable Version](https://camo.githubusercontent.com/94ef22192e2b728aeea47db48e87a1d06d27bc943f72862ebc93c3c434f81e2a/68747470733a2f2f706f7365722e707567782e6f72672f7761706d6f7267616e2f6d6f7270686f732f762f737461626c65)](https://packagist.org/packages/wapmorgan/morphos)[![License](https://camo.githubusercontent.com/4f55668126a3e61aaffcff731b96896482b893a916ffbba9a79b045c371d5210/68747470733a2f2f706f7365722e707567782e6f72672f7761706d6f7267616e2f6d6f7270686f732f6c6963656e7365)](https://packagist.org/packages/wapmorgan/morphos)[![Total Downloads](https://camo.githubusercontent.com/9f83cc4995dc5d4e58786ea31e143ac2b085f7869ac35dd78ed3f2aedb60f877/68747470733a2f2f706f7365722e707567782e6f72672f7761706d6f7267616e2f6d6f7270686f732f646f776e6c6f616473)](https://packagist.org/packages/wapmorgan/morphos)[![Daily Downloads](https://camo.githubusercontent.com/8c9029e1314c77c6ec250b93903dbf44cc67497de9432ca020c240211367b7d4/68747470733a2f2f706f7365722e707567782e6f72672f7761706d6f7267616e2f6d6f7270686f732f642f6461696c79)](https://packagist.org/packages/wapmorgan/morphos)[![Latest Unstable Version](https://camo.githubusercontent.com/e7f5eb3a4b9371574f983abe0c550851e23a010e59ea645f3134ca542739e54e/68747470733a2f2f706f7365722e707567782e6f72672f7761706d6f7267616e2f6d6f7270686f732f762f756e737461626c65)](https://packagist.org/packages/wapmorgan/morphos)

Tests &amp; Quality: [![Build Status](https://camo.githubusercontent.com/6aedd4919ffc5902546f791f631d48b26a6e9ec323fdaa0429da93ebb76d561a/68747470733a2f2f6170702e7472617669732d63692e636f6d2f7761706d6f7267616e2f4d6f7270686f732e7376673f6272616e63683d6d6173746572)](https://app.travis-ci.com/github/wapmorgan/Morphos)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/1b93a34ed3dfef93540654ae99ccf322ca4f52a9a81b2b31eecb110ec95a6323/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7761706d6f7267616e2f4d6f7270686f732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/wapmorgan/Morphos/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/68dce049c66480d10bce93e03bdc50605d4b0c7a44c4e986807a74602194a1b8/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7761706d6f7267616e2f4d6f7270686f732f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/wapmorgan/Morphos/?branch=master)

Features
--------

[](#features)

- \[✓\] Inflection of Personal names (Фамилия, Имя, Отчество) (Russian)
- \[✓\] Inflection of Geographical names (Страны/Города) (Russian)
- \[✓\] Declension/Pluralization of nouns and adjectives (Russian, English)
- \[✓\] Generation numerals of numbers (количественные и порядковые) (Russian, English)
- \[✓\] Spelling out amounts of money (Russian)
- \[✓\] Spelling out time units and intervals (Russian, English)

Table of contents
-----------------

[](#table-of-contents)

1. Installation
2. Quick start
3. Documentation
4. Contributing

Installation
------------

[](#installation)

### As PHP library

[](#as-php-library)

- Download library through composer:

```
composer require wapmorgan/morphos

```

or install via adapter:

- Adapter for Blade: [wapmorgan/morphos-blade](https://github.com/wapmorgan/Morphos-Blade)
- Adapter for Twig: [wapmorgan/morphos-twig](https://github.com/wapmorgan/Morphos-Twig)
- Adapter for Yii2: [wapmorgan/yii2-inflection](https://github.com/wapmorgan/yii2-inflection)

### As a separate service

[](#as-a-separate-service)

The server starts in a container from [docker image](https://hub.docker.com/r/wapmorgan/morphos) and listens 8080 port for GET-requests.

Integrate service into your stack (for example, docker compose)

```
services:
  morphos:
    image: wapmorgan/morphos:3.2.30
    ports:
      - 8093:8080
```

or standalone container:

```
docker run --env NUM_WORKERS=4 --rm --publish 8093:8080 -v wapmorgan/morphos:3.2.30
```

*Tip*: adjust `NUM_WORKERS` env variable if you will send a lot of load to service. By default, it's 4.

There are **API:** marks in documentation for functions, that exposed as service endpoints. Just pass them the same arguments as to PHP-functions/methods.

Quick Start
-----------

[](#quick-start)

#### Russian

[](#russian)

```
// Inflect russian names:
morphos\Russian\inflectName('Иванов Петр', 'родительный') => 'Иванова Петра'

// Inflect geographical names:
morphos\Russian\GeographicalNamesInflection::getCase('Москва', 'родительный') => 'Москвы'

// Pluralize russian nouns and adjectives:
morphos\Russian\pluralize(10, 'новый дом') => '10 новых домов'

// Generate russian cardinal numerals:
morphos\Russian\CardinalNumeralGenerator::getCase(567, 'именительный') => 'пятьсот шестьдесят семь'

// Generate russian ordinal numerals:
morphos\Russian\OrdinalNumeralGenerator::getCase(961, 'именительный') => 'девятьсот шестьдесят первый'

// Generate russian time difference
morphos\Russian\TimeSpeller::spellDifference(time() + 3600, morphos\TimeSpeller::DIRECTION) => 'через 1 час'

// other functions described in README-ru.md
```

#### English

[](#english)

```
// Pluralize english nouns:
morphos\English\pluralize(10, 'house') => '10 houses'

// Generate english cardinal numerals:
morphos\English\CardinalNumeralGenerator::generate(567) => 'five hundred sixty-seven'

// Generate english ordinal numerals:
morphos\English\OrdinalNumeralGenerator::generate(961) => 'nine hundred sixty-first'

// Generate english time difference
morphos\English\TimeSpeller::spellDifference(time() + 3600, morphos\TimeSpeller::DIRECTION) => 'in 1 hour'
```

Documentation
=============

[](#documentation)

- [Русская морфология](README-ru.md) в файле README-ru.md
- [English morphology](README-en.md) in file README-en.md

Contributing
============

[](#contributing)

See [CONTRIBUTING.md](CONTRIBUTING.md) for this.

###  Health Score

61

—

FairBetter than 99% of packages

Maintenance58

Moderate activity, may be stable

Popularity63

Solid adoption and visibility

Community39

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 92% 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 ~60 days

Recently: every ~271 days

Total

65

Last Release

325d ago

Major Versions

1.0.0 → 2.0.02015-07-02

2.4.2 → 3.0.02017-04-08

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6000618?v=4)[Sergey](/maintainers/wapmorgan)[@wapmorgan](https://github.com/wapmorgan)

---

Top Contributors

[![wapmorgan](https://avatars.githubusercontent.com/u/6000618?v=4)](https://github.com/wapmorgan "wapmorgan (483 commits)")[![anoriar](https://avatars.githubusercontent.com/u/25775103?v=4)](https://github.com/anoriar "anoriar (5 commits)")[![denysdesign](https://avatars.githubusercontent.com/u/1041797?v=4)](https://github.com/denysdesign "denysdesign (3 commits)")[![DocentBF](https://avatars.githubusercontent.com/u/14574432?v=4)](https://github.com/DocentBF "DocentBF (3 commits)")[![iGusev](https://avatars.githubusercontent.com/u/1555767?v=4)](https://github.com/iGusev "iGusev (3 commits)")[![alex-storchak](https://avatars.githubusercontent.com/u/47216380?v=4)](https://github.com/alex-storchak "alex-storchak (3 commits)")[![alexlcdee](https://avatars.githubusercontent.com/u/9890043?v=4)](https://github.com/alexlcdee "alexlcdee (2 commits)")[![altapo](https://avatars.githubusercontent.com/u/837355?v=4)](https://github.com/altapo "altapo (2 commits)")[![dixstonz3](https://avatars.githubusercontent.com/u/24312986?v=4)](https://github.com/dixstonz3 "dixstonz3 (2 commits)")[![prgrant](https://avatars.githubusercontent.com/u/11554708?v=4)](https://github.com/prgrant "prgrant (2 commits)")[![b1rdex](https://avatars.githubusercontent.com/u/312855?v=4)](https://github.com/b1rdex "b1rdex (2 commits)")[![leshakhov](https://avatars.githubusercontent.com/u/10301330?v=4)](https://github.com/leshakhov "leshakhov (2 commits)")[![StarkOne](https://avatars.githubusercontent.com/u/22250527?v=4)](https://github.com/StarkOne "StarkOne (1 commits)")[![Zuzest](https://avatars.githubusercontent.com/u/5245836?v=4)](https://github.com/Zuzest "Zuzest (1 commits)")[![bsv-hub](https://avatars.githubusercontent.com/u/43187016?v=4)](https://github.com/bsv-hub "bsv-hub (1 commits)")[![dastanaron](https://avatars.githubusercontent.com/u/25330618?v=4)](https://github.com/dastanaron "dastanaron (1 commits)")[![detrenasama](https://avatars.githubusercontent.com/u/60028336?v=4)](https://github.com/detrenasama "detrenasama (1 commits)")[![Impeck](https://avatars.githubusercontent.com/u/1071117?v=4)](https://github.com/Impeck "Impeck (1 commits)")[![maks-lukonin](https://avatars.githubusercontent.com/u/5488341?v=4)](https://github.com/maks-lukonin "maks-lukonin (1 commits)")[![mspirkov](https://avatars.githubusercontent.com/u/63721828?v=4)](https://github.com/mspirkov "mspirkov (1 commits)")

---

Tags

cardinaldeclinationenglish-specifichumanizermorphologynamesnumeralordinalpluralizationreactrussianrussian-specificmoneylanguageinflectiontimespellingenglishrussianpluralizationcardinalordinalnounsmorphologydeclensionhuman-friendlyNumeralsadjectivespersonal namesgeographical names

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wapmorgan-morphos/health.svg)

```
[![Health](https://phpackages.com/badges/wapmorgan-morphos/health.svg)](https://phpackages.com/packages/wapmorgan-morphos)
```

###  Alternatives

[doctrine/inflector

PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.

11.4k855.8M711](/packages/doctrine-inflector)[phpoption/phpoption

Option Type for PHP

2.7k541.2M159](/packages/phpoption-phpoption)[moneyphp/money

PHP implementation of Fowler's Money pattern

4.8k82.5M422](/packages/moneyphp-money)[brick/money

Money and currency library

1.9k37.9M102](/packages/brick-money)[symfony/clock

Decouples applications from the system clock

431168.9M205](/packages/symfony-clock)[heureka/inflection

Czech inflection library

6163.9k](/packages/heureka-inflection)

PHPackages © 2026

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