Exemplo n.º 1
0
 function closing()
 {
     wfProfileIn(__METHOD__);
     $closing = new _HWLDF_WordAccumulator();
     foreach ($this->edits as $edit) {
         if ($edit->type == 'copy') {
             $closing->addWords($edit->closing);
         } elseif ($edit->closing) {
             $closing->addWords($edit->closing, 'ins');
         }
     }
     $lines = $closing->getLines();
     wfProfileOut(__METHOD__);
     return $lines;
 }
Exemplo n.º 2
0
 function _final()
 {
     $final = new _HWLDF_WordAccumulator();
     foreach ($this->edits as $edit) {
         if ($edit->type == 'copy') {
             $final->addWords($edit->final);
         } elseif ($edit->final) {
             $final->addWords($edit->final, 'ins');
         }
     }
     return $final->getLines();
 }
 public function closing()
 {
     $closing = new _HWLDF_WordAccumulator();
     foreach ($this->edits as $edit) {
         if ($edit->type == 'copy') {
             $closing->addWords($edit->closing);
         } elseif ($edit->closing) {
             $closing->addWords($edit->closing, 'mark');
         }
     }
     return $closing->getLines();
 }
Exemplo n.º 4
0
 function inline()
 {
     $orig = new _HWLDF_WordAccumulator();
     foreach ($this->edits as $edit) {
         if ($edit->type == 'copy') {
             $orig->addWords($edit->closing);
         } elseif ($edit->type == 'change') {
             $orig->addWords($edit->orig, 'del');
             $orig->addWords($edit->closing, 'add');
         } elseif ($edit->type == 'delete') {
             $orig->addWords($edit->orig, 'del');
         } elseif ($edit->type == 'add') {
             $orig->addWords($edit->closing, 'add');
         } elseif ($edit->orig) {
             $orig->addWords($edit->orig, 'del');
         }
     }
     return $orig->getLines();
 }
Exemplo n.º 5
0
 function closing()
 {
     $fname = 'WordLevelDiff::closing';
     wfProfileIn($fname);
     $closing = new _HWLDF_WordAccumulator();
     foreach ($this->edits as $edit) {
         if ($edit->type == 'copy') {
             $closing->addWords($edit->closing);
         } elseif ($edit->closing) {
             $closing->addWords($edit->closing, 'ins');
         }
     }
     $lines = $closing->getLines();
     wfProfileOut($fname);
     return $lines;
 }
Exemplo n.º 6
0
 function all($tags = array(), $nbsp = '', $html = null)
 {
     $text = new _HWLDF_WordAccumulator($tags, $nbsp, $html);
     foreach ($this->edits as $edit) {
         if (is_a($edit, '_DiffOp_Copy')) {
             $text->addWords($edit->orig);
         } else {
             if ($edit->orig) {
                 $text->addWords($edit->orig, 'del');
             }
             if ($edit->_final) {
                 $text->addWords($edit->_final, 'ins');
             }
         }
     }
     return $text->getLines();
 }