ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Refinery\String\Levenshtein Class Reference
+ Collaboration diagram for ILIAS\Refinery\String\Levenshtein:

Public Member Functions

 standard (string $str, int $maximumDistance)
 Creates an object of the Levenshtein class This class calculates the levenshtein distance with a default value of 1.0 per insert, delete, replacement. More...
 
 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 parameters for insert, delete, replacement. More...
 

Detailed Description

Definition at line 26 of file Levenshtein.php.

Member Function Documentation

◆ custom()

ILIAS\Refinery\String\Levenshtein::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 parameters for insert, delete, replacement.

Parameters
string$strstring for distance calculation
int$maximum_distancemaximum allowed distance, limits the calculation of the Levenshtein distance. A maximum distance of 0 disables the function
float$cost_insertioncost for insertion default 1.0
float$cost_replacementcost for replacement default 1.0
float$cost_deletioncost for deletion default 1.0
Returns
Transformation

Definition at line 52 of file Levenshtein.php.

58  : Transformation {
59  return new LevenshteinTransformation($str, $maximum_distance, $cost_insertion, $cost_replacement, $cost_deletion);
60  }

◆ standard()

ILIAS\Refinery\String\Levenshtein::standard ( string  $str,
int  $maximumDistance 
)

Creates an object of the Levenshtein class This class calculates the levenshtein distance with a default value of 1.0 per insert, delete, replacement.

Parameters
string$strstring for distance calculation
int$maximumDistancemaximum allowed distance, limits the calculation of the Levenshtein distance. A maximum distance of 0 disables the function
Returns
Transformation

Definition at line 36 of file Levenshtein.php.

36  : Transformation
37  {
38  return new LevenshteinTransformation($str, $maximumDistance, 1.0, 1.0, 1.0);
39  }

The documentation for this class was generated from the following file: