PHP Classes

File: example.damerauLevenshtein.php

Recommend this page to a friend!
  Classes of Ph4r05   Damerau Levenshtein   example.damerauLevenshtein.php   Download  
File: example.damerauLevenshtein.php
Role: Example script
Content type: text/plain
Description: Example of usage
Class: Damerau Levenshtein
Get text similarity level with Damerau-Levenshtein
Author: By
Last change: missing php start tag
Date: 13 years ago
Size: 412 bytes
 

Contents

Class file image Download
<?php
require(dirname(__FILE__) . '/class.damerauLevenshtein.php');

$dl = new DamerauLevenshtein('dk gry', 'dark grey', 1,6,6,1);
echo
"Edit distance: ";
var_dump($dl->getSimilarity());

echo
"Similarity, relative: ";
var_dump($dl->getRelativeDistance());

echo
"Maximum possible edit distance: ";
var_dump($dl->getMaximalDistance());

echo
"Matrix: \n";
echo
$dl->displayMatrix() . "\n";