PHP Classes
elePHPant
Icontem

File: example.damerauLevenshtein.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 3 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";