PHP Classes
elePHPant
Icontem

Morphos: Get the different forms of language words

Recommend this page to a friend!
  Info   View files Documentation   View files View files (58)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-09-01 (20 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 206 All time: 7,950 This week: 290Up
Version License PHP version Categories
morphos 1.38Free for non-comm...5.4Algorithms, PHP 5, Text processing
Description Author

This class can get the different forms of language words.

It provides several classes that can take words in a given language and determine declension of the word, i.e. the inflection of the word to indicate plurality (singular and plural), gender (male or female), and case (nominative, genitive, dative, accusative, ablative, and prepositional).

Currently it provides specialized classes for Russian declension and English plurality.

Innovation Award
PHP Programming Innovation award nominee
December 2014
Number 2


Prize: One downloadable copy of Komodo IDE
Many words can have multiple forms by changing inflection aspects like the gender, number or the case of those words.

This class implements a solution that can obtain variations of words changing its inflection aspects. It can also detect if a word is a variation of another word.

These capabilities are implemented in a way that can support multiple languages by providing specialization classes for each language.

Manuel Lemos
  Performance   Level  
Name: Sergey Vanyushin is available for providing paid consulting. Contact Sergey Vanyushin .
Classes: 15 packages by
Country: Russian Federation Russian Federation
Age: 21
All time rank: 79528 in Russian Federation Russian Federation
Week rank: 25 Up4 in Russian Federation Russian Federation Up
Innovation award
Innovation award
Nominee: 14x

Winner: 1x

Details

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, English)

Table of contents

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

Installation

Quick Start

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

    // Inflect 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 `php // 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' `

Library documentation

Contributing

See CONTRIBUTING.md for this.

  Files folder image Files  
File Role Description
Files folder imagebin (1 file)
Files folder imagesrc (13 files, 2 directories)
Files folder imagetests (2 directories)
Files folder imageweb (1 file)
Plain text file composer.json Data Auxiliary data
Plain text file CONTRIBUTING.md Data Auxiliary data
Plain text file LICENSE.md Lic. License text
Plain text file README-en.md Doc. Documentation
Plain text file README-ru.md Doc. Documentation
Plain text file README.md Doc. Documentation
Plain text file _config.yml Data Auxiliary data

  Files folder image Files  /  bin  
File Role Description
  Plain text file morphos Class Class source

  Files folder image Files  /  src  
File Role Description
Files folder imageEnglish (5 files)
Files folder imageRussian (14 files)
  Plain text file BaseInflection.php Class Class source
  Plain text file Cases.php Class Class source
  Plain text file CasesHelper.php Class Class source
  Plain text file CurrenciesHelper.php Class Class source
  Plain text file Currency.php Class Class source
  Plain text file Gender.php Class Class source
  Plain text file initialization.php Aux. Auxiliary script
  Plain text file MoneySpeller.php Class Class source
  Plain text file NamesInflection.php Class Class source
  Plain text file NounPluralization.php Class Class source
  Plain text file NumeralGenerator.php Class Class source
  Plain text file S.php Class Class source
  Plain text file TimeSpeller.php Class Class source

  Files folder image Files  /  src  /  English  
File Role Description
  Plain text file CardinalNumeralGenerator.php Class Class source
  Plain text file functions.php Aux. Auxiliary script
  Plain text file NounPluralization.php Class Class source
  Plain text file OrdinalNumeralGenerator.php Class Class source
  Plain text file TimeSpeller.php Class Class source

  Files folder image Files  /  src  /  Russian  
File Role Description
  Plain text file CardinalNumeralGenerator.php Class Class source
  Plain text file Cases.php Class Class source
  Plain text file CasesHelper.php Class Class source
  Plain text file FirstNamesInflection.php Class Class source
  Plain text file functions.php Example Example script
  Plain text file GeographicalNamesInflection.php Class Class source
  Plain text file LastNamesInflection.php Class Class source
  Plain text file MiddleNamesInflection.php Class Class source
  Plain text file MoneySpeller.php Class Class source
  Plain text file NounDeclension.php Class Class source
  Plain text file NounPluralization.php Class Class source
  Plain text file OrdinalNumeralGenerator.php Class Class source
  Plain text file RussianLanguage.php Class Class source
  Plain text file TimeSpeller.php Class Class source

  Files folder image Files  /  tests  
File Role Description
Files folder imageEnglish (5 files)
Files folder imageRussian (12 files)

  Files folder image Files  /  tests  /  English  
File Role Description
  Plain text file CardinalNumeralTest.php Class Class source
  Plain text file FunctionsTest.php Class Class source
  Plain text file NounPluralizationTest.php Class Class source
  Plain text file OrdinalNumeralTest.php Class Class source
  Plain text file TimeSpellerTest.php Class Class source

  Files folder image Files  /  tests  /  Russian  
File Role Description
  Plain text file CardinalNumeralTest.php Class Class source
  Plain text file FirstNamesInflecionTest.php Class Class source
  Plain text file FunctionsTest.php Class Class source
  Plain text file GeographicalNamesInflectionTest.php Class Class source
  Plain text file LastNamesInflectionTest.php Class Class source
  Plain text file MiddleNamesInflectionTest.php Class Class source
  Plain text file MoneySpellerTest.php Class Class source
  Plain text file NounDeclensionTest.php Class Class source
  Plain text file NounPluralizationTest.php Class Class source
  Plain text file OrdinalNumeralTest.php Class Class source
  Plain text file RussianLanguageTest.php Class Class source
  Plain text file TimeSpellerTest.php Class Class source

  Files folder image Files  /  web  
File Role Description
  Plain text file index.php Example Application script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:206
This week:0
All time:7,950
This week:290Up