ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Levenshtein.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Refinery\String;
22
25
27{
36 public function standard(string $str, int $maximumDistance): Transformation
37 {
38 return new LevenshteinTransformation($str, $maximumDistance, 1.0, 1.0, 1.0);
39 }
40
52 public function custom(
53 string $str,
54 int $maximum_distance,
55 float $cost_insertion,
56 float $cost_replacement,
57 float $cost_deletion
59 return new LevenshteinTransformation($str, $maximum_distance, $cost_insertion, $cost_replacement, $cost_deletion);
60 }
61}
standard(string $str, int $maximumDistance)
Creates an object of the Levenshtein class This class calculates the levenshtein distance with a defa...
Definition: Levenshtein.php:36
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:52
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A transformation is a function from one datatype to another.