ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
Levenshtein.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: CaseOfLabel.php:21