PHP Classes

File: runTest

Recommend this page to a friend!
  Classes of mohammad anzawi   PHP Similarity Between Two Strings   runTest   Download  
File: runTest
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP Similarity Between Two Strings
Calculate the similarity level of two text strings
Author: By
Last change:
Date: 2 years ago
Size: 578 bytes
 

Contents

Class file image Download
<?php $val = getopt(null, ["s1:", "s2:"]); if(!is_dir('./vendor')) { echo "run 'composer install' first. \n\r"; exit; } if (!$val['s1'] || !$val['s2']) { echo "you must inter 2 strings \n\r"; echo "Example: php runTest --s1=\"first string\" --s2=\"second string\" \n\r"; exit; } require_once 'vendor/autoload.php'; echo "levenshtein distances is ( " . \Anzawi\FindDiff\Levenshtein::findDiff($val['s1'], $val['s2']) . " ) \n\r"; echo "hamming distances is ( " . \Anzawi\FindDiff\Hamming::calculate($val['s1'], $val['s2']) . " ) \n\r";