Russian metaphone phonetic algorithm implementation for PHP
port of ruby's https://github.com/pavlo/russian_metaphone
https://en.wikipedia.org/wiki/Metaphone
see http://forum.aeroion.ru/topic461.html (Russian algorithm description)
Installation
composer require insolita/metaphone
Usage
<?php
$word = '????';
$phonetic = (new Metaphone())->processWord($word); //????
Default set of filters include filter for lastname endings, if you want exclude only these filter, you can use helper
$withLastnames = (new Metaphone())->processWord('????????????'); //??????#
$withoutLastnames = (new Metaphone())->skipLastnames()->processWord('????????????'); //????????????
Provide custom filters. Each filter must implement insolita\metaphone\Filter
$metaphone = new Metaphone([Normalize::class, new CustomFilter($params), new HandleConsonants(true), ...])
$phonetic = $metaphone->processWord($word);
See tests folder for better understanding filters