|Last Updated|| ||Ratings|| ||Unique User Downloads|| ||Download Rankings|
|2019-01-14 (6 days ago) ||Not enough user ratings||Total: 221 This week: 6||All time: 7,964 This week: 66|
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.
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.
A morphological solution for Russian and English language written completely in PHP.
Tests & Quality:
- [✓] 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
- Quick start
- Download library through composer:
composer require wapmorgan/morphos
// 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
// 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'
See CONTRIBUTING.md for this.
||Applications that use this package
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.