PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Ujah Chigozie peter   PHP Check Similarity of People Names   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP Check Similarity of People Names
Get a similarity score between two people names
Author: By
Last change:
Date: 5 months ago
Size: 817 bytes
 

Contents

Class file image Download

PHP Similarity Checker

PHP class to check the similarity between two items

Functions

  • Calculates the similarity between two persons name

Installation Guide via Composer:

composer require nanoblocktech/php-similarity-check

Usages

Initalize class

use Luminova\ExtraUtils\SimilarityChecker\Check;

Check similarity score between two names

$check = new Check();
try {
    $score = $check->name('Peter Foo', 'Paul Foo'); 

    echo "Percentage: {$score->getRate()}%\n";
    echo "Ratio: {$distance->getRatio()}\n";
} catch (InvalidArgumentException $e){
    echo $e->getMessage();
}

Check similarity score between two string

$score = Check::compare('Foo', 'Faa'); 

echo "Percentage: {$score->getRate()}%\n";
echo "Ratio: {$distance->getRatio()}\n";