diff options
author | phkoehn <phkoehn@1f5c12ca-751b-0410-a591-d2e778427230> | 2010-05-05 03:04:10 +0400 |
---|---|---|
committer | phkoehn <phkoehn@1f5c12ca-751b-0410-a591-d2e778427230> | 2010-05-05 03:04:10 +0400 |
commit | 2ed6804f12e6703610fb4ad40567de7cd9f17348 (patch) | |
tree | 5a207145f8d07173018043a28b06709269c46301 /scripts/ems/web/diff.php | |
parent | 0118733a45ad8f9513187717f19289bbc1c7ba53 (diff) |
official release of experiment.perl
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@3224 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'scripts/ems/web/diff.php')
-rw-r--r-- | scripts/ems/web/diff.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/scripts/ems/web/diff.php b/scripts/ems/web/diff.php new file mode 100644 index 000000000..17d61a069 --- /dev/null +++ b/scripts/ems/web/diff.php @@ -0,0 +1,39 @@ +<?php + +function diff() { + global $experiment; + $display = $_GET[run]; + sort($display); + while (list($i,$run) = each($display)) { + if ($i==0) { + print "<H3>Experiment $run</H3>\n"; + } + else { + $diff = compute_diff($display[0],$run); + } + print "<table border=1 cellpadding=1 cellspacing=0><tr>"; + output_score($run,$experiment[$run]); + print "</tr></table>"; + } +} + +function compute_diff($base,$change) { + $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 ($base_value != $parameter_change[$parameter]) { + output_diff_line($parameter,$base_value,$parameter_change[$parameter]); + } + } + while (list($parameter,$change_value) = each($parameter_change)) { + if (!$parameter_base[$parameter]) { + output_diff_line($parameter,"",$change_value); + } + } + print "</TABLE>\n"; +} + +function output_diff_line($parameter,$base_value,$change_value) { + print "<TR><TD BGCOLOR=yellow>$parameter</TD><TD BGCOLOR=lightgreen>$change_value</TD></TR><TR><TD> </TD><TD BGCOLOR=#cccccc>$base_value</TD></TR>\n"; +} |