ILIAS  release_7 Revision v7.30-3-g800a261c036
Levenshtein.php
Go to the documentation of this file.
1<?php
18declare(strict_types=1);
19
20namespace ILIAS\Refinery\String;
21
24
26{
35 public function standard(string $str, int $maximumDistance): Transformation
36 {
37 return new LevenshteinTransformation($str, $maximumDistance, 1.0, 1.0, 1.0);
38 }
39
51 public function custom(
52 string $str,
53 int $maximum_distance,
54 float $cost_insertion,
55 float $cost_replacement,
56 float $cost_deletion
58 return new LevenshteinTransformation($str, $maximum_distance, $cost_insertion, $cost_replacement, $cost_deletion);
59 }
60}
An exception for terminatinating execution or to throw for unit testing.
standard(string $str, int $maximumDistance)
Creates an object of the Levenshtein class This class calculates the levenshtein distance with a defa...
Definition: Levenshtein.php:35
custom(string $str, int $maximum_distance, float $cost_insertion, float $cost_replacement, float $cost_deletion)
Creates an object of the Levenshtein class This class calculates the levenshtein distance with custom...
Definition: Levenshtein.php:51
A transformation is a function from one datatype to another.