ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Levenshtein.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace 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
58  ): Transformation {
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
A transformation is a function from one datatype to another.