PHP Classes

PHP Similarity Between Two Strings: Calculate the similarity level of two text strings

Recommend this page to a friend!

  Author Author  
Picture of mohammad anzawi
Name: mohammad anzawi <contact>
Classes: 5 packages by
Country: Jordan Jordan
Innovation award
Innovation award
Nominee: 1x


  Detailed description   Download Download .zip .tar.gz  
This package can calculate the similarity level of two text strings.

It can take two text strings and apply algorithms to calculate a number that represents the similarity between those strings.

The class that implements the Hamming distance algorithm returns the number of text characters that are different in each string.

The class that implements the Levenshtein algorithm returns a number that represents the number of steps that are necessary to change the first string into the second strings.

Details

find-diff

calculate levenshtein distances &amp; hamming distances between 2 strings using PHP

please note : PHP provided build-in functions to do what this library do it's just for fun !

levenshtein function

gmp_hamdist function

main Classes located in (/libs/) directory

installation

  • open your `terminal`/`cmd`/`powershell`
  • navigate to your projects directory
  • run `git clone https://github.com/anzawi/find-diff.git`
  • navigate to project `cd find-diff`
  • run `composer install`

this project require find-diff as a library check composer.json file and take a look on repositories section.

run test in command-line

  • open your `terminal`/`cmd`/`powershell`
  • navigate to project directory
  • run `php runTest --s1="Mohammad" --s2="Mohammed"`

run test project

  • run any preferred php server
  • navigate to project
  • you will see a simple form
  • start testing

don't forget to run test using phpunit ./vendor/bin/phpunit


  Classes of mohammad anzawi  >  PHP Similarity Between Two Strings  >  Download Download .zip .tar.gz  >  Support forum Support forum (1)  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: PHP Similarity Between Two Strings
Base name: find-diff
Description: Calculate the similarity level of two text strings
Version: -
PHP version: 5
License: GNU Lesser General Public License (LGPL)
 
  Groups   Applications   Files Files  

  Groups  
Group folder image Algorithms Numerical and statistical algorithms View top rated classes
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Text processing Manipulating and validating text data View top rated classes


  Applications that use this package  
No pages of applications that use this class were specified.

Add link image If you know an application of this package, send a message to the author to add a link here.

  Files folder image Files  
File Role Description
Files folder imageapp (1 file)
Files folder imagelibs (2 files, 1 directory)
Files folder imagetests (2 files)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file readme.md Doc. Documentation
Accessible without login Plain text file runTest Data Auxiliary data

  Files folder image Files  /  app  
File Role Description
  Accessible without login Plain text file Action.php Class Class source

  Files folder image Files  /  libs  
File Role Description
Files folder imagesrc (2 files)
  Accessible without login Plain text file composer.json Data Auxiliary data
  Accessible without login Plain text file composer.lock Data Auxiliary data

  Files folder image Files  /  libs  /  src  
File Role Description
  Accessible without login Plain text file Hamming.php Class Class source
  Accessible without login Plain text file Levenshtein.php Class Class source

  Files folder image Files  /  tests  
File Role Description
  Accessible without login Plain text file HammingTest.php Class Class source
  Accessible without login Plain text file LevenshteinTest.php Class Class source

Download Download all files: find-diff.tar.gz find-diff.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.
For more information send a message to info at phpclasses dot org.