From f8283d3f58588e00c2f4887f130bc91d891ad76f Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Sun, 16 Feb 2014 01:58:50 +0100 Subject: fix max==0&&min==0 --- rampfion.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'rampfion.rb') diff --git a/rampfion.rb b/rampfion.rb index 479ca2b..23bedcb 100755 --- a/rampfion.rb +++ b/rampfion.rb @@ -67,6 +67,7 @@ end def adjust_model_scores kbest, factor min = kbest.map{ |k| k.scores[:decoder] }.min max = kbest.map{ |k| k.scores[:decoder] }.max + return if min==0&&max==0 kbest.each { |k| k.scores[:decoder] = factor*((k.scores[:decoder]-min)/(max-min)) } end -- cgit v1.2.3