frantzmiccoli/phphoneticindexing

Phonetic indexing for PHP, uses the standard library for English, Cologne phonetics for German and a custom algorithm for French

1.0.2-stable 2020-08-30 21:07 UTC

This package is not auto-updated.

Last update: 2024-09-10 15:20:09 UTC


README

Build Status

Scope

We try to provide different languages phonetic indexing methods.

Installation

composer require frantzmiccoli/phphoneticindexing

Usage

use PhPhoneticIndexing\GetPhoneticIndex;

$getPhoneticIndex = new GetPhoneticIndex();

var_dump($getPhoneticIndex->getPhoneticIndex('carabine', 'fr')); // karabyn

Please note that if you wish to support new languages, those can be added using $getPhoneticIndex->addLanguage().

French implementation

  1. Remove numbers and work in lower case.
  2. Proceed with substitution in the given order.
  3. Remove duplicates
  4. Remove -
  5. If wished remove aeiouy123

Side note

Part of this was developed during a live programming session. Unfortunately the quality is awful, but the links are here: