There is a problem, I do not understand where and because of what it appears.

require_once(codes::get('path') . 'phpmorphy/src/common.php'); $dict_bundle = new phpMorphy_FilesBundle(codes::get('path') . 'phpmorphy/dicts', 'rus'); $morphy = new phpMorphy($dict_bundle, array( 'storage' => PHPMORPHY_STORAGE_MEM )); $text = '袩褉懈屑械褉薪褘泄 蟹邪锌褉芯褋 锌芯懈褋泻邪'; $q = explode(' ', mb_strtoupper($text)); $base_form = $morphy->getBaseForm($q); $all_forms = $morphy->getAllForms($q); $pseudo_root = $morphy->getPseudoRoot($q); a::b($q, $base_form, $all_forms, $pseudo_root); // a::b - print_r, 泻褉褍褌芯泄 褌芯谢褜泻芯. 

The result of running php.

 Array ( [0] => 袩袪袠袦袝袪袧蝎袡 [1] => 袟袗袩袪袨小 [2] => 袩袨袠小袣袗 ) Array ( [袩袪袠袦袝袪袧蝎袡] => Array ( [0] => 袩袪袠袦袝袪袧蝎袡 ) [袩袨袠小袣袗] => Array ( [0] => 袩袨袠小袣袗 ) [袟袗袩袪袨小] => Array ( [0] => 袟袗袩袪袨小 ) ) Array ( [袩袪袠袦袝袪袧蝎袡] => Array ( [0] => 袩袪袠袦袝袪袧蝎袡 [1] => 袩袪袠袦袝袪袧袨袚袨 [2] => 袩袪袠袦袝袪袧袨袦校 [3] => 袩袪袠袦袝袪袧蝎袦 [4] => 袩袪袠袦袝袪袧袨袦 [5] => 袩袪袠袦袝袪袧蝎袝 [6] => 袩袪袠袦袝袪袧蝎啸 [7] => 袩袪袠袦袝袪袧蝎袦袠 [8] => 袩袪袠袦袝袪袧袗携 [9] => 袩袪袠袦袝袪袧袨袡 [10] => 袩袪袠袦袝袪袧校挟 [11] => 袩袪袠袦袝袪袧袨挟 [12] => 袩袪袠袦袝袪袧袨袝 ) [袩袨袠小袣袗] => Array ( [0] => 袩袨袠小袣袗 [1] => 袩袨袠小袣袠 [2] => 袩袨袠小袣袝 [3] => 袩袨袠小袣校 [4] => 袩袨袠小袣袨袡 [5] => 袩袨袠小袣袨挟 [6] => 袩袨袠小袨袣 [7] => 袩袨袠小袣袗袦 [8] => 袩袨袠小袣袗袦袠 [9] => 袩袨袠小袣袗啸 ) [袟袗袩袪袨小] => Array ( [0] => 袟袗袩袪袨小 [1] => 袟袗袩袪袨小袗 [2] => 袟袗袩袪袨小校 [3] => 袟袗袩袪袨小袨袦 [4] => 袟袗袩袪袨小袝 [5] => 袟袗袩袪袨小蝎 [6] => 袟袗袩袪袨小袨袙 [7] => 袟袗袩袪袨小袗袦 [8] => 袟袗袩袪袨小袗袦袠 [9] => 袟袗袩袪袨小袗啸 ) ) Array ( [袩袪袠袦袝袪袧蝎袡] => Array ( [0] => 袩袪袠袦袝袪袧 ) [袩袨袠小袣袗] => Array ( [0] => 袩袨袠小 ) [袟袗袩袪袨小] => Array ( [0] => 袟袗袩袪袨小 ) ) 

Arrays are different from those indicated in the post where I take the information - search, taking into account the morphology of the Russian language . I set different options in phpmorphy, wrote different locales (setlocale), the result is the same.

Maybe someone knows the solution to the problem?

  • one
    >> The result of running php. >> Arrays are different with those that are listed in the post that you keep back. - Alex Kapustin
  • What's not clear? Arrays by reference. - Oleg
  • Thanks, I will try. - Oleg
  • The question can be closed, made using a different encoding and older versions of the library. - Oleg

1 answer 1

Most likely some kind of ambush with the word 袩袨袠小袣 as getAllForms generates a superfluous 袩袨袠小袨袣 should not be there. Most likely they fixed something from the moment of writing the article :-) Try to take the base of the earlier version

  • These encodings are still. - Oleg