acrossoffwest/morhpy-wrapper

Wrapper for phpMorphy

1.0.0 2020-04-24 14:49 UTC

This package is auto-updated.

Last update: 2024-10-28 23:16:10 UTC


README

phpMorphy --- morphological analyzer library for Russian, English, German and Ukrainian languages.
acrossoffwest/morphy-wrapper is Laravel wrapper for phpMorphy library with PHP7.4 support.

Source website (in russian): http://phpmorphy.sourceforge.net/ SF project: http://sourceforge.net/projects/phpmorphy
Wrapper on Github: https://github.com/cijic/phpmorphy

This library allow retireve follow morph information for any word:

  • Base (normal) form
  • All forms
  • Grammatical (part of speech, grammems) information

Install

Via Composer

$ composer require acrossoffwest/morphy-wrapper

Easy way for usage Russian language

Get a word in necessary form

echo morphy_get_word_by_case('Москва', ['ПР']);
// Output: москве

Get all forms of a word

echo morphy_get_word_by_case('Фитнес', ['ПР'], [
   'фитнес' => [
       'ПР' => 'фитнесе'
   ]
]);
// Output: фитнесе

Usage another languages

If you wanna use another languages you have to use Acrossoffwest\MorphyWrapper\Morphy class

use Acrossoffwest\MorphyWrapper\Morphy;

$morphy = new Morphy('en');
echo $morphy->getPseudoRoot('FIGHTY');
// Output: