PHP Class TextAnalysis\Comparisons\LongestCommonSubstringComparison

Inheritance: implements TextAnalysis\Interfaces\ISimilarity, implements TextAnalysis\Interfaces\IDistance
Mostrar archivo Open project: yooper/php-text-analysis Class Usage Examples

Protected Properties

Property Type Description
$cache array Cache for holding substring arrays key/value array
$useCache boolean Using caching to improve preformance on text2 inputs

Public Methods

Method Description
__construct ( boolean $useCache = false )
__destruct ( )
distance ( string $text1, string $text2 ) : integer Returns the string length of the longest common substring (LCS)
getCache ( ) : array
similarity ( string $text1, string $text2 ) : string Returns the Longest common substring

Method Details

__construct() public method

public __construct ( boolean $useCache = false )
$useCache boolean

__destruct() public method

public __destruct ( )

distance() public method

Returns the string length of the longest common substring (LCS)
public distance ( string $text1, string $text2 ) : integer
$text1 string
$text2 string
return integer

getCache() public method

public getCache ( ) : array
return array

similarity() public method

Returns the Longest common substring
public similarity ( string $text1, string $text2 ) : string
$text1 string
$text2 string
return string

Property Details

$cache protected_oe property

Cache for holding substring arrays key/value array
protected array $cache
return array

$useCache protected_oe property

Using caching to improve preformance on text2 inputs
protected bool $useCache
return boolean