Skip to content

Latest commit

 

History

History
78 lines (57 loc) · 3.31 KB

README.md

File metadata and controls

78 lines (57 loc) · 3.31 KB

Morphos

A morphological solution for Russian and English language written completely in PHP.

Composer package Latest Stable Version License Total Downloads Latest Unstable Version

Tests & Quality: Build Status Scrutinizer Code Quality

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)

Table of contents

  1. Installation
  2. Quick start
  3. Library documentation
  4. Contributing

Installation

  • Download library through composer:
composer require wapmorgan/morphos

Quick Start

  • Russian:

    // Decline russian names:
    morphos\Russian\inflectName('Иванов Петр', 'родительный') => 'Иванова Петра'
    
    // Decline geographical names:
    morphos\Russian\GeographicalNamesInflection::getCase('Москва', 'родительный') => 'Москвы'
    
    // Pluralize russian nouns:
    morphos\Russian\pluralize('дом', 10) => '10 домов'
    
    // Generate russian cardinal numerals:
    morphos\Russian\CardinalNumeralGenerator::getCase(567, 'именительный') => 'пятьсот шестьдесят семь'
    
    // Generate russian ordinal numerals:
    morphos\Russian\OrdinalNumeralGenerator::getCase(961, 'именительный') => 'девятьсот шестьдесят первый'
    
    // other functions described in README-ru.md
  • English

    // Pluralize english nouns:
    morphos\English\pluralize('house') => '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'

Library documentation

Contributing

See CONTRIBUTING.md for this.