Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
Class representing a 'diff' between two sequences of strings. More...
Public Member Functions | |
__construct ($from_lines, $to_lines) | |
Constructor. More... | |
_check ($from_lines, $to_lines) | |
Check a WikiDiff for validity. More... | |
closing () | |
Get the closing set of lines. More... | |
isEmpty () | |
Check for empty diff. More... | |
lcs () | |
Compute the length of the Longest Common Subsequence (LCS). More... | |
orig () | |
Get the original set of lines. More... | |
reverse () | |
Compute reversed WikiDiff. More... | |
WikiDiff ($from_lines, $to_lines) | |
Old syntax of class constructor. More... | |
Public Attributes | |
$edits | |
Class representing a 'diff' between two sequences of strings.
WikiDiff::__construct | ( | $from_lines, | |
$to_lines | |||
) |
Constructor.
Computes diff between sequences of strings.
$from_lines | array An array of strings. (Typically these are lines from a file.) |
$to_lines | array An array of strings. |
Reimplemented in WordLevelWikiDiff.
WikiDiff::_check | ( | $from_lines, | |
$to_lines | |||
) |
Check a WikiDiff for validity.
This is here only for debugging purposes.
WikiDiff::closing | ( | ) |
Get the closing set of lines.
This reconstructs the $to_lines parameter passed to the constructor.
array | The sequence of strings. |
Reimplemented in WordLevelWikiDiff.
WikiDiff::isEmpty | ( | ) |
Check for empty diff.
bool | True iff two sequences were identical. |
WikiDiff::lcs | ( | ) |
Compute the length of the Longest Common Subsequence (LCS).
This is mostly for diagnostic purposed.
int | The length of the LCS. |
WikiDiff::orig | ( | ) |
Get the original set of lines.
This reconstructs the $from_lines parameter passed to the constructor.
array | The original sequence of strings. |
Reimplemented in WordLevelWikiDiff.
WikiDiff::reverse | ( | ) |
WikiDiff::WikiDiff | ( | $from_lines, | |
$to_lines | |||
) |