Recommend this page to a friend! |
Download |
Info | Documentation | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 37 | All time: 10,957 This week: 673 |
Version | License | PHP version | Categories | |||
metaphone 1.0 | MIT/X Consortium ... | 5 | Algorithms, PHP 5, Text processing, A... |
Description | Author | |||
This package is specific mainly for applications used in Russian Federation .
This package can generate a phonetic representation of Russian word. Innovation Award
|
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)
composer require insolita/metaphone
<?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
Files (17) |
File | Role | Description | ||
---|---|---|---|---|
.github (1 directory) | ||||
src (2 files, 1 directory) | ||||
tests (6 files) | ||||
composer.json | Data | Auxiliary data | ||
phpunit.xml.dist | Data | Auxiliary data | ||
README.md | Doc. | Read me |
Files (17) | / | src |
File | Role | Description | ||
---|---|---|---|---|
filters (5 files) | ||||
Filter.php | Class | Class source | ||
Metaphone.php | Class | Class source |
Files (17) | / | src | / | filters |
File | Role | Description |
---|---|---|
HandleConsonants.php | Class | Class source |
HandleLastnameEndings.php | Class | Class source |
Normalize.php | Class | Class source |
RemoveDoubleChars.php | Class | Class source |
Replacements.php | Class | Class source |
Files (17) | / | tests |
File | Role | Description |
---|---|---|
HandleConsonantsTest.php | Class | Class source |
HandleLastnameEndingsTest.php | Class | Class source |
MetaphoneTest.php | Class | Class source |
NormalizeTest.php | Class | Class source |
RemoveDoubleCharsTest.php | Class | Class source |
ReplacementsTest.php | Class | Class source |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.