diff --git a/ecrire/inc/diff.php b/ecrire/inc/diff.php index 5df4e4d871a39ed970b24cfafb7a9aec5c3713d2..dab2d09ab355e3caec83925c3ea09eeccff37290 100644 --- a/ecrire/inc/diff.php +++ b/ecrire/inc/diff.php @@ -96,35 +96,6 @@ function lcs($s, $t) { return array(0 => array(), 1 => array()); } - -// http://doc.spip.org/@test_lcs -function test_lcs($a, $b) { - $s = explode(" ", $a); - $t = explode(" ", $b); - - $t0 = explode(" ", microtime()); - list($r1, $r2) = lcs($s, $t); - $t1 = explode(" ", microtime()); - $dt = $t1[0] + $t1[1] - $t0[0] - $t0[1]; - echo join(" ", $r1)."<br />"; - echo join(" ", $r2)."<p>"; - echo "<div style='font-weight: bold; color: red;'>$dt s.</div>"; -} - -// http://doc.spip.org/@test_lcs_opt -function test_lcs_opt($s) { - $s = preg_split(',\s+,', $s); - - $t0 = explode(" ", microtime()); - $t = lcs_opt($s); - $t1 = explode(" ", microtime()); - $dt = $t1[0] + $t1[1] - $t0[0] - $t0[1]; - echo join(" ", $s)."<br />"; - echo join(" ", $t)."<p>"; - echo "<div style='font-weight: bold; color: red;'>$dt s.</div>"; -} - - // // Generation de diff a plusieurs etages // diff --git a/ecrire/inc/vieilles_defs.php b/ecrire/inc/vieilles_defs.php index f6817b725df7f623fa3518db78258614f4fbaa17..99c6ca301daf06ad0ded42e0e85a16ce7396bafe 100644 --- a/ecrire/inc/vieilles_defs.php +++ b/ecrire/inc/vieilles_defs.php @@ -185,4 +185,31 @@ function afficher_formulaire_date($script, $args, $texte, $jour, $mois, $annee) . "</td></tr></table>" . "</form>"; } + +// http://doc.spip.org/@test_lcs +function test_lcs($a, $b) { + $s = explode(" ", $a); + $t = explode(" ", $b); + + $t0 = explode(" ", microtime()); + list($r1, $r2) = lcs($s, $t); + $t1 = explode(" ", microtime()); + $dt = $t1[0] + $t1[1] - $t0[0] - $t0[1]; + echo join(" ", $r1)."<br />"; + echo join(" ", $r2)."<p>"; + echo "<div style='font-weight: bold; color: red;'>$dt s.</div>"; +} + +// http://doc.spip.org/@test_lcs_opt +function test_lcs_opt($s) { + $s = preg_split(',\s+,', $s); + + $t0 = explode(" ", microtime()); + $t = lcs_opt($s); + $t1 = explode(" ", microtime()); + $dt = $t1[0] + $t1[1] - $t0[0] - $t0[1]; + echo join(" ", $s)."<br />"; + echo join(" ", $t)."<p>"; + echo "<div style='font-weight: bold; color: red;'>$dt s.</div>"; +} ?> \ No newline at end of file