ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
WordLevelDiff Class Reference
+ Inheritance diagram for WordLevelDiff:
+ Collaboration diagram for WordLevelDiff:

Public Member Functions

 __construct ($orig_lines, $closing_lines)
 
 _split ($lines)
 
 orig ()
 
 closing ()
 
- Public Member Functions inherited from MappedDiff
 __construct ( $from_lines, $to_lines, $mapped_from_lines, $mapped_to_lines)
 Constructor. More...
 
- Public Member Functions inherited from Diff
 __construct ($from_lines, $to_lines)
 Constructor. More...
 
 reverse ()
 Compute reversed Diff. 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...
 
 closing ()
 Get the closing set of lines. More...
 
 _check ($from_lines, $to_lines)
 Check a Diff for validity. More...
 

Data Fields

const MAX_LINE_LENGTH = 10000
 
- Data Fields inherited from Diff
 $edits
 

Detailed Description

Definition at line 1772 of file class.WordLevelDiff.php.

Constructor & Destructor Documentation

◆ __construct()

WordLevelDiff::__construct (   $orig_lines,
  $closing_lines 
)

Definition at line 1776 of file class.WordLevelDiff.php.

1787 {
1788  const MAX_LINE_LENGTH = 10000;
1789 
1790  public function __construct($orig_lines, $closing_lines)
1791  {
__construct($orig_lines, $closing_lines)

Member Function Documentation

◆ _split()

WordLevelDiff::_split (   $lines)

Definition at line 1793 of file class.WordLevelDiff.php.

1808  {
1809  $fname = 'WordLevelDiff::_split';
1810  //wfProfileIn( $fname );
1811 
1812  $words = array();
1813  $stripped = array();
1814  $first = true;
1815  foreach ($lines as $line) {
1816  # If the line is too long, just pretend the entire line is one big word
1817  # This prevents resource exhaustion problems
1818  if ($first) {
1819  $first = false;
1820  } else {
1821  $words[] = "\n";
1822  $stripped[] = "\n";
1823  }
1824  if (strlen($line) > self::MAX_LINE_LENGTH) {
1825  $words[] = $line;
1826  $stripped[] = $line;
1827  } else {
Create styles array
The data for the language used.

◆ closing()

WordLevelDiff::closing ( )

Definition at line 1847 of file class.WordLevelDiff.php.

References $orig, and _HWLDF_WordAccumulator\addWords().

1849  {
1850  if ($edit->type == 'copy') {
1851  $orig->addWords($edit->orig);
1852  } elseif ($edit->orig) {
1853  $orig->addWords($edit->orig, 'del');
1854  }
1855  }
1856  $lines = $orig->getLines();
1857  //wfProfileOut( $fname );
1858  return $lines;
1859  }
1860 
1861  public function closing()
1862  {
1863  $fname = 'WordLevelDiff::closing';
+ Here is the call graph for this function:

◆ orig()

WordLevelDiff::orig ( )

Definition at line 1829 of file class.WordLevelDiff.php.

References $m, and array.

1830  : (?!< \n) [^\S\n])? /xs',
1831  $line,
1832  $m
1833  )) {
1834  $words = array_merge($words, $m[0]);
1835  $stripped = array_merge($stripped, $m[1]);
1836  }
1837  }
1838  }
1839  //wfProfileOut( $fname );
1840  return array($words, $stripped);
1841  }
1842 
1843  public function orig()
1844  {
1845  $fname = 'WordLevelDiff::orig';
if(! $in) print Initializing normalization quick check tables n

Field Documentation

◆ MAX_LINE_LENGTH

const WordLevelDiff::MAX_LINE_LENGTH = 10000

Definition at line 1774 of file class.WordLevelDiff.php.


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