Popularity
0.8
Stable
Activity
4.1
Declining
9
2
0

Programming language: PHP
Tags: Strings     Miscellaneous     Library     Utils     String Manipulation     Phonetic     Soundex    

Russian metaphone phonetic algorithm implementation for PHP alternatives and similar libraries

Based on the "Strings" category.
Alternatively, view Russian metaphone phonetic algorithm implementation for PHP alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of Russian metaphone phonetic algorithm implementation for PHP or a related project?

Add another 'Strings' Library

README

Russian metaphone phonetic algorithm implementation for PHP

metaphone 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