Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Public Attributes | List of all members
WordLevelWikiDiff Class Reference
Inheritance diagram for WordLevelWikiDiff:
MappedWikiDiff WikiDiff

Public Member Functions

 __construct ($orig_lines, $closing_lines)
 Constructor. More...
 
 _check ($from_lines, $to_lines)
 Check a WikiDiff for validity. More...
 
 _split ($lines)
 
 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
 

Constructor & Destructor Documentation

◆ __construct()

WordLevelWikiDiff::__construct (   $from_lines,
  $to_lines 
)

Constructor.

Computes diff between sequences of strings.

Parameters
$from_linesarray An array of strings. (Typically these are lines from a file.)
$to_linesarray An array of strings.

Reimplemented from WikiDiff.

Member Function Documentation

◆ _check()

WikiDiff::_check (   $from_lines,
  $to_lines 
)
inherited

Check a WikiDiff for validity.

This is here only for debugging purposes.

◆ closing()

WordLevelWikiDiff::closing ( )

Get the closing set of lines.

This reconstructs the $to_lines parameter passed to the constructor.

Return values
arrayThe sequence of strings.

Reimplemented from WikiDiff.

◆ isEmpty()

WikiDiff::isEmpty ( )
inherited

Check for empty diff.

Return values
boolTrue iff two sequences were identical.

◆ lcs()

WikiDiff::lcs ( )
inherited

Compute the length of the Longest Common Subsequence (LCS).

This is mostly for diagnostic purposed.

Return values
intThe length of the LCS.

◆ orig()

WordLevelWikiDiff::orig ( )

Get the original set of lines.

This reconstructs the $from_lines parameter passed to the constructor.

Return values
arrayThe original sequence of strings.

Reimplemented from WikiDiff.

◆ reverse()

WikiDiff::reverse ( )
inherited

Compute reversed WikiDiff.

SYNOPSIS:

$diff = new WikiDiff($lines1, $lines2); $rev = $diff->reverse();

Return values
objectA WikiDiff object representing the inverse of the original diff.

◆ WikiDiff()

WikiDiff::WikiDiff (   $from_lines,
  $to_lines 
)
inherited

Old syntax of class constructor.

Deprecated in PHP7.

Deprecated:
since Moodle 3.1

The documentation for this class was generated from the following file: