2017 © Pedro Peláez
 

library phonetic-algorithms

Phonetic-Algorithms for fuzzy searching | PHP

image

voku/phonetic-algorithms

Phonetic-Algorithms for fuzzy searching | PHP

  • Saturday, December 23, 2017
  • by voku
  • Repository
  • 2 Watchers
  • 6 Stars
  • 6,972 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 8 Versions
  • 4 % Grown

The README.md

Build Status Coverage Status Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Phonetic-Algorithms

Description

  • "PhoneticGerman"-Class:

A phonetic algorithms for the german language via "Kölner Phonetik": en.wikipedia.org/wiki/Cologne_phonetics, (*2)

  • "PhoneticEnglish"-Class:

A phonetic algorithms for the english language via "metaphone": en.wikipedia.org/wiki/Metaphone, (*3)

  • "PhoneticFrench"-Class:

A phonetic algorithms for the french language via "SOUNDEX FR": www.roudoudou.com/phonetic.php, (*4)

Installation

  1. Install and use composer in your project.
  2. Require this package via composer:
composer require voku/phonetic-algorithms

Usage

You the "phonetic_word"-method if you need a fuzzy-search for single words e.g. last-names or product-names., (*5)

use voku\helper\Phonetic;

$words = array(
  'Moelleken',
  'Mölleken',
  'Möleken',
  'Moeleken',
  'Moellecken',
  'Möllecken',
  'Mölecken',
);
$phonetic = new Phonetic('de');
foreach ($words as $word) {
  $phonetic->phonetic_word($string); // '6546'
}

You can use the "phonetic_sentence"-method to process sentences., (*6)

use voku\helper\Phonetic;

$string = 'Ein Satz mit vielen Wortern';
$phonetic = new Phonetic('de');
$phonetic->phonetic_sentence($string, (bool) false, (false|int) false); 

// [
//   'Ein' => '06', 
//   'Satz' => '8', 
//   'mit' => '62', 
//   'vielen' => '356', 
//   'Wortern' => '37276'
// ]

You can use the "phonetic_matches"-method to search for words in an array of words., (*7)

use voku\helper\Phonetic;

$phonetic = new Phonetic('de');

$tests = array(
    'Moelleken',  // '6546',
    'Mölleken',   // '6546',
    'Möleken',    // '6546',
    'Moeleken',   // '6546',
    'oder',       // '027',
    'was',        // '38',
    'Moellecken', // '6546',
    'Möllecken',  // '6546',
    'Mölecken',   // '6546',
);

$phonetic->phonetic_matches('Moelleken', $tests);

// [
//   'Moelleken'  => 'Moelleken',
//   'Mölleken'   => 'Moelleken',
//   'Möleken'    => 'Moelleken',
//   'Moeleken'   => 'Moelleken',
//   'Moellecken' => 'Moelleken',
//   'Möllecken'  => 'Moelleken',
//   'Mölecken'   => 'Moelleken',
// ]

History

See CHANGELOG for the full history of changes., (*8)

The Versions

23/12 2017

dev-master

9999999-dev

Phonetic-Algorithms for fuzzy searching | PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

algorithm phonetic metaphone kölner phonetik homophone

23/12 2017

4.0.0

4.0.0.0

Phonetic-Algorithms for fuzzy searching | PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

algorithm phonetic metaphone kölner phonetik homophone

03/12 2017

3.0.2

3.0.2.0

Phonetic-Algorithms for fuzzy searching | PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

algorithm phonetic metaphone kölner phonetik homophone

01/12 2017

3.0.1

3.0.1.0

Phonetic-Algorithms for fuzzy searching | PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

algorithm phonetic metaphone kölner phonetik homophone

13/11 2017

3.0.0

3.0.0.0

Phonetic-Algorithms for fuzzy searching | PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

algorithm phonetic metaphone kölner phonetik homophone

12/05 2017

2.1.0

2.1.0.0

Phonetic-Algorithms for fuzzy searching | PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

algorithm phonetic metaphone kölner phonetik homophone

05/04 2017

2.0.0

2.0.0.0

Phonetic-Algorithms for fuzzy searching | PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

algorithm phonetic metaphone kölner phonetik homophone

27/03 2017

1.0.0

1.0.0.0

Phonetic-Algorithms for fuzzy searching | PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

algorithm phonetic metaphone kölner phonetik homophone