2017 © Pedro Peláez
 

library 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.

image

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.

  • Saturday, July 28, 2018
  • by wapmorgan
  • Repository
  • 43 Watchers
  • 454 Stars
  • 21,442 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 46 Forks
  • 0 Open issues
  • 47 Versions
  • 29 % Grown

The README.md

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., (*1)

Latest Stable Version License Total Downloads Daily Downloads Latest Unstable Version, (*2)

Tests & Quality: Build Status Scrutinizer Code Quality Code Coverage, (*3)

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

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

Installation

As PHP library

  • Download library through composer:
composer require wapmorgan/morphos

or install via adapter:, (*4)

As a separate service

The server starts in a container from docker image and listens 8080 port for GET-requests., (*5)

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

services:
  morphos:
    image: wapmorgan/morphos:3.2.29
    ports:
      - 8093:8080

or standalone container:, (*7)

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

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

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

Quick Start

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

// 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

Contributing

See CONTRIBUTING.md for this., (*10)

The Versions

28/07 2018

dev-master

9999999-dev http://morphos.io

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.

  Sources   Download

MIT

The Requires

  • ext-mbstring *
  • php >=5.4.0

 

The Development Requires

by Sergey Vanyushin

language time money numerals russian english inflection nouns ordinal spelling declension human-friendly adjectives morphology pluralization cardinal personal names geographical names

27/06 2018

3.2.11

3.2.11.0 http://morphos.tech

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.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

by Sergey Vanyushin

language time money numerals russian english inflection nouns ordinal spelling declension human-friendly adjectives morphology pluralization cardinal personal names geographical names

22/05 2018

3.2.10

3.2.10.0 http://morphos.tech

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.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

by Sergey Vanyushin

language time money numerals russian english inflection nouns ordinal spelling declension human-friendly adjectives morphology pluralization cardinal personal names geographical names

16/05 2018

3.2.9

3.2.9.0 http://morphos.tech

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.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

by Sergey Vanyushin

language time money numerals russian english inflection nouns ordinal spelling declension human-friendly adjectives morphology pluralization cardinal personal names geographical names

06/02 2018

3.2.8

3.2.8.0 http://morphos.tech

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.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

by Sergey Vanyushin

language time money numerals russian english inflection nouns ordinal spelling declension human-friendly adjectives morphology pluralization cardinal personal names geographical names

17/11 2017

3.2.7

3.2.7.0 http://morphos.tech

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.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

by Sergey Vanyushin

language time money numerals russian english inflection nouns ordinal spelling declension human-friendly adjectives morphology pluralization cardinal personal names geographical names

17/11 2017

3.2.6

3.2.6.0 http://morphos.tech

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.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

by Sergey Vanyushin

language time money numerals russian english inflection nouns ordinal spelling declension human-friendly adjectives morphology pluralization cardinal personal names geographical names

20/09 2017

3.2.5

3.2.5.0 http://morphos.tech

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.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

by Sergey Vanyushin

language time money numerals russian english inflection nouns ordinal spelling declension human-friendly adjectives morphology pluralization cardinal personal names geographical names

30/08 2017

3.2.4

3.2.4.0 http://morphos.tech

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.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

by Sergey Vanyushin

language time money numerals russian english inflection nouns ordinal spelling declension human-friendly adjectives morphology pluralization cardinal personal names geographical names

26/08 2017

3.2.3

3.2.3.0 http://morphos.tech

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.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

by Sergey Vanyushin

language time money numerals russian english inflection nouns ordinal spelling declension human-friendly adjectives morphology pluralization cardinal personal names geographical names

11/08 2017

3.2.2

3.2.2.0 http://morphos.tech

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.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

by Sergey Vanyushin

language time money numerals russian english inflection nouns ordinal spelling declension human-friendly adjectives morphology pluralization cardinal personal names geographical names

03/08 2017

3.2.1

3.2.1.0 http://morphos.tech

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.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

by Sergey Vanyushin

language time money numerals russian english inflection nouns ordinal spelling declension human-friendly adjectives morphology pluralization cardinal personal names geographical names

18/07 2017

3.2.0

3.2.0.0 http://morphos.tech

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.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

by Sergey Vanyushin

language time money numerals russian english inflection nouns ordinal spelling declension human-friendly adjectives morphology pluralization cardinal personal names geographical names

13/07 2017

3.0.9

3.0.9.0

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

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language numerals russian english ordinal declension morphology pluralization cardinal

12/07 2017

3.0.8

3.0.8.0

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

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language numerals russian english ordinal declension morphology pluralization cardinal

11/07 2017

3.0.7

3.0.7.0

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

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language numerals russian english ordinal declension morphology pluralization cardinal

10/07 2017

3.0.6

3.0.6.0

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

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language numerals russian english ordinal declension morphology pluralization cardinal

05/07 2017

3.0.5

3.0.5.0

A morphological solution written completely in the PHP language. Supports Russian and English. Provides classes to decline personal names, geographical names, decline and pluralize nouns and generate cardinal and ordinal numerals.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language numerals russian english ordinal declension morphology pluralization cardinal

13/06 2017

3.0.4

3.0.4.0

A morphological solution written completely in the PHP language. Supports Russian and English. Provides classes to decline personal names, geographical names, decline and pluralize nouns and generate cardinal and ordinal numerals.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language numerals russian english ordinal declension morphology pluralization cardinal

09/06 2017

3.0.3

3.0.3.0

A morphological solution written completely in the PHP language. Supports Russian and English. Provides classes to decline personal names, geographical names, decline and pluralize nouns and generate cardinal and ordinal numerals.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language numerals russian english ordinal declension morphology pluralization cardinal

06/05 2017

3.0.2

3.0.2.0

A morphological solution written completely in the PHP language. Supports Russian and English. Provides classes to decline personal names, geographical names, decline and pluralize nouns and generate cardinal and ordinal numerals.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language numerals russian english ordinal declension morphology pluralization cardinal

21/04 2017

3.0.1

3.0.1.0

A morphological solution written completely in the PHP language. Supports Russian and English. Provides classes to decline personal names, geographical names, decline and pluralize nouns and generate cardinal and ordinal numerals.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language numerals russian english ordinal declension morphology pluralization cardinal

08/04 2017

3.0.0

3.0.0.0

A morphological solution written completely in the PHP language. Supports Russian and English. Provides classes to decline personal names, decline and pluralize nouns and generate cardinal and ordinal numerals.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language numerals russian english ordinal declension morphology pluralization cardinal

05/04 2017

2.4.2

2.4.2.0

A morphological solution written completely in the PHP language. Supports Russian and English. Provides classes to decline personal names, decline and pluralize nouns and generate cardinal and ordinal numerals.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language numerals russian english ordinal declension morphology pluralization cardinal

15/03 2017

2.4.1

2.4.1.0

A morphological solution written completely in the PHP language. Supports Russian and English. Provides classes to decline personal names, decline and pluralize nouns and generate cardinal and ordinal numerals.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language numerals russian english ordinal declension morphology pluralization cardinal

15/03 2017

2.4.0

2.4.0.0

A morphological solution written completely in the PHP language. Supports Russian and English. Provides classes to decline personal names, decline and pluralize nouns and generate cardinal and ordinal numerals.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language numerals russian english ordinal declension morphology pluralization cardinal

26/02 2017

2.3.5

2.3.5.0

A morphological solution written completely in the PHP language. Supports Russian and English. Provides classes to decline Names, decline and pluralize nouns and generate cardinal and ordinal numerals.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language numerals russian english ordinal declension morphology pluralization cardinal

26/02 2017

2.3.4

2.3.4.0

A morphological solution written completely in the PHP language. Supports Russian and English. Provides classes to decline Names, decline and pluralize nouns and generate cardinal and ordinal numerals.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language numerals russian english ordinal declension morphology pluralization cardinal

25/02 2017

2.3.3

2.3.3.0

A morphological solution written completely in the PHP language. Supports Russian and English. Provides classes to decline Names, decline and pluralize nouns and generate cardinal and ordinal numerals.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language numerals russian english ordinal declension morphology pluralization cardinal

22/02 2017

2.3.2

2.3.2.0

A morphological solution written completely in the PHP language. Supports Russian and English. Provides classes to decline Names, decline and pluralize nouns and generate cardinal and ordinal numerals.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language numerals russian english ordinal declension morphology pluralization cardinal

22/02 2017

2.3.1

2.3.1.0

A morphological solution written completely in the PHP language. Supports Russian and English. Provides classes to decline Names, decline and pluralize nouns and generate cardinal numerals.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language russian english declension morphology pluralization

20/02 2017

2.3.0

2.3.0.0

A morphological solution written completely in the PHP language. Supports Russian and English. Provides classes to decline Names, decline and pluralize nouns and generate cardinal numerals.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language russian english declension morphology pluralization

13/02 2017

2.2.9

2.2.9.0

A morphological solution written completely in the PHP language. Supports Russian and English. Provides classes to decline First/Middle/Last names and nouns.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language russian english declension morphology pluralization

04/02 2017

2.2.8

2.2.8.0

A morphological solution written completely in the PHP language. Supports Russian and English. Provides classes to decline First/Middle/Last names and nouns.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language russian english declension morphology pluralization

03/02 2017

2.2.7

2.2.7.0

A morphological solution written completely in the PHP language. Supports Russian and English. Provides classes to decline First/Middle/Last names and nouns.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language russian english declension morphology pluralization

03/02 2017

2.2.6

2.2.6.0

A morphological solution written completely in the PHP language. Supports Russian and English. Provides classes to decline First/Middle/Last names and nouns.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language russian english declension morphology pluralization

03/02 2017

2.2.5

2.2.5.0

A morphological solution written completely in the PHP language. Supports Russian and English. Provides classes to decline First/Middle/Last names and nouns.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language russian english declension morphology pluralization

03/02 2017

2.2.4

2.2.4.0

A morphological solution written completely in the PHP language. Supports Russian and English. Provides classes to decline First/Middle/Last names and nouns.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language russian english declension morphology pluralization

03/02 2017

2.2.3

2.2.3.0

A morphological solution written completely in the PHP language. Supports Russian and English. Provides classes to decline First/Middle/Last names and nouns.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language russian english declension morphology pluralization

02/02 2017

2.2.2

2.2.2.0

A morphological solution written completely in the PHP language. Supports Russian and English. Provides classes to decline First/Middle/Last names and nouns.

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language russian english declension morphology pluralization

02/02 2017

2.2.1

2.2.1.0

Morphological solution

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language russian english declension morphology pluralization

29/01 2017

2.2.0

2.2.0.0

Morphological solution

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

language russian english declension morphology pluralization

28/01 2017

2.1.0

2.1.0.0

Morphological solution

  Sources   Download

MIT

The Requires

  • ext-mbstring *

 

The Development Requires

language russian english declension morphology pluralization

28/01 2017

2.0.2

2.0.2.0

Morphological solution

  Sources   Download

MIT

The Development Requires

language russian morphology

09/01 2017

2.0.1

2.0.1.0

Morphological solution

  Sources   Download

MIT

The Development Requires

language russian morphology

02/07 2015

2.0.0

2.0.0.0

a morphological solution

  Sources   Download

The Development Requires

16/11 2014

1.0.0

1.0.0.0

a morphological decision

  Sources   Download