Метод | Описание | |
---|---|---|
charsToLines ( array &$diffs, array $lineArray ) | Rehydrate the text in a diff from a string of line hashes to real lines of text. | |
commonPrefix ( string $text1, string $text2 ) : integer | Determine the common prefix of two strings. | |
commonSuffix ( string $text1, string $text2 ) : integer | Determine the common suffix of two strings. | |
commontOverlap ( string $text1, string $text2 ) : integer | Determine if the suffix of one string is the prefix of another. | |
halfMatch ( string $text1, string $text2 ) : null | array | Do the two texts share a substring which is at least half the length of the longer text? This speedup can produce non-minimal diffs. | |
linesToChars ( string $text1, string $text2 ) : array | Split two texts into an array of strings. Reduce the texts to a string of hashes where each Unicode character represents one line. |
Метод | Описание | |
---|---|---|
halfMatchI ( string $longtext, string $shorttext, integer $i ) : null | array | Does a substring of shorttext exist within longtext such that the substring is at least half the length of longtext? | |
linesToCharsMunge ( string $text, array &$lineArray, array &$lineHash ) : string | Split a text into an array of strings. Reduce the texts to a string of hashes where each Unicode character represents one line. |
public charsToLines ( array &$diffs, array $lineArray ) | ||
$diffs | array | Array of diff arrays. |
$lineArray | array | Array of unique strings. |
public halfMatch ( string $text1, string $text2 ) : null | array | ||
$text1 | string | First string. |
$text2 | string | Second string. |
Результат | null | array | Five element array, containing the prefix of text1, the suffix of text1, the prefix of text2, the suffix of text2 and the common middle. Or null if there was no match. |
protected halfMatchI ( string $longtext, string $shorttext, integer $i ) : null | array | ||
$longtext | string | Longer string. |
$shorttext | string | Shorter string. |
$i | integer | Start index of quarter length substring within longtext. |
Результат | null | array | Five element array, containing the prefix of longtext, the suffix of longtext, the prefix of shorttext, the suffix of shorttext and the common middle. Or null if there was no match. |
public linesToChars ( string $text1, string $text2 ) : array | ||
$text1 | string | First string. |
$text2 | string | Second string. |
Результат | array | Three element array, containing the encoded text1, the encoded text2 and the array of unique strings. The zeroth element of the array of unique strings is intentionally blank. |