diff options
author | phkoehn <phkoehn@1f5c12ca-751b-0410-a591-d2e778427230> | 2011-06-17 03:43:29 +0400 |
---|---|---|
committer | phkoehn <phkoehn@1f5c12ca-751b-0410-a591-d2e778427230> | 2011-06-17 03:43:29 +0400 |
commit | 4285a8e236b3bc91aace803876b62df01b4186b8 (patch) | |
tree | 0054e5893e49e23ab4fb015cd6c66d6bc4eaa67a /scripts/ems/web/diff.php | |
parent | ab3460591c546534a57c771ce8864c7da4e3c6a5 (diff) |
various experiment.perl improvements: split filter and decode/tune; extensions to analysis.perl, especially precision by coverage graphs
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@4018 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'scripts/ems/web/diff.php')
-rw-r--r-- | scripts/ems/web/diff.php | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/scripts/ems/web/diff.php b/scripts/ems/web/diff.php index 74f0f6572..71e732af1 100644 --- a/scripts/ems/web/diff.php +++ b/scripts/ems/web/diff.php @@ -18,20 +18,31 @@ function diff() { } function compute_diff($base,$change) { + print "<H3>Experiment $change</H3><TABLE>"; + + // get parameter values for the two runs $parameter_base = load_parameter($base); $parameter_change = load_parameter($change); - print "<H3>Experiment $change</H3><TABLE>"; - while (list($parameter,$base_value) = each($parameter_base)) { - if (!array_key_exists($parameter,$parameter_change)) { - $parameter_change[$parameter] = ""; - } - if ($base_value != $parameter_change[$parameter]) { - output_diff_line($parameter,$base_value,$parameter_change[$parameter]); + + // get parameters and sort them + $all_parameters = array_keys($parameter_base); + foreach (array_keys($parameter_change) as $parameter) { + if (!array_key_exists($parameter,$parameter_base)) { + $all_parameters[] = $parameter; } } - while (list($parameter,$change_value) = each($parameter_change)) { + sort($all_parameters); + + // display differences + foreach ($all_parameters as $parameter) { if (!array_key_exists($parameter,$parameter_base)) { - output_diff_line($parameter,"",$change_value); + $parameter_base[$parameter] = ""; + } + if (!array_key_exists($parameter,$parameter_change)) { + $parameter_change[$parameter] = ""; + } + if ($parameter_base[$parameter] != $parameter_change[$parameter]) { + output_diff_line($parameter,$parameter_base[$parameter],$parameter_change[$parameter]); } } print "</TABLE>\n"; |