Text_Diff::lcs
Computes the length of the Longest Common Subsequence (LCS).
This is mostly for diagnostic purposes.
Method of the class: Text_Diff{}
No Hooks.
Returns
Int. The length of the LCS.
Usage
$Text_Diff = new Text_Diff(); $Text_Diff->lcs();
Text_Diff::lcs() Text Diff::lcs code WP 6.8.3
function lcs()
{
$lcs = 0;
foreach ($this->_edits as $edit) {
if (is_a($edit, 'Text_Diff_Op_copy')) {
$lcs += count($edit->orig);
}
}
return $lcs;
}