Открытые члены | |
getDiffHtml ($a, $b) | |
getDiffScript (array $a, array $b) | |
Защищенные члены | |
init () | |
longestCommonSubsequence (array $a, $lowerA, $upperA, array $b, $lowerB, $upperB) | |
shortestMiddleSnake (array $a, $lowerA, $upperA, array $b, $lowerB, $upperB) | |
createDiff (array $a, array $b) | |
Защищенные данные | |
$upVector = array() | |
$downVector = array() | |
$modifiedA = array() | |
$modifiedB = array() | |
This Class implements the Difference Algorithm published in "An O(ND) Difference Algorithm and its Variations" by Eugene Myers Algorithmica Vol. 1 No. 2, 1986, p 251.
|
protected |
getDiffHtml | ( | $a, | |
$b ) |
Function finds the difference between two versions of text and creates html output with highlighted edits to transform text from first to second version.
string | $a | First version of text to be compared. |
string | $b | Second version of text to be compared. |
getDiffScript | ( | array | $a, |
array | $b ) |
Function compares two arrays and creates edit script, that is required to transform array $a to array $b
array | $a | First array to be compared. |
array | $b | Second array to be compared. |
|
protected |
|
protected |
Function looks for longest common subsequence between two array
array | $a | First array to be compared. |
int | $lowerA | Lower bound of the first array. |
int | $upperA | Upper bound of the first array. |
array | $b | Second array to be compared. |
int | $lowerB | Lower bound of the second array. |
int | $upperB | Upper bound of the second array. |
|
protected |
Function looks for shortest middle snake between two arrays (see Meyer's work "An O(ND) Difference Algorithm and its Variations")
array | $a | First array to be compared. |
int | $lowerA | Lower bound of the first array. |
int | $upperA | Upper bound of the first array. |
array | $b | Second array to be compared. |
int | $lowerB | Lower bound of the second array. |
int | $upperB | Upper bound of the second array. |