SHIBATA Hiroshi
null****@okkez*****
2014年 4月 26日 (土) 17:41:22 JST
SHIBATA Hiroshi 2014-04-26 17:41:22 +0900 (Sat, 26 Apr 2014) New Revision: 618d76823a826d77322ef4969d866b2f0d1eb9c7 https://github.com/hiki/hiki/commit/618d76823a826d77322ef4969d866b2f0d1eb9c7 Message: Array doesn't have to_f methods Modified files: plugin/50bayes_filter.rb Modified: plugin/50bayes_filter.rb (+3 -3) =================================================================== --- plugin/50bayes_filter.rb 2014-04-26 17:18:34 +0900 (08a2054) +++ plugin/50bayes_filter.rb 2014-04-26 17:41:22 +0900 (803c537) @@ -74,8 +74,8 @@ class BayesFilterConfig @conf[REPORT] =****@reque*****[REPORT] @conf[SHARE_DB] =****@reque*****[SHARE_DB] @conf[LIMIT_OF_SUBMITTED_PAGES] =****@reque*****[LIMIT_OF_SUBMITTED_PAGES] || 50 - threshold_spam = (@request.params[THRESHOLD] || 0.95).to_f - threshold_ham = (@request.params[THRESHOLD_HAM] || 0.05).to_f + threshold_spam = (@request.params[THRESHOLD].join.to_f || 0.95) + threshold_ham = (@request.params[THRESHOLD_HAM].join.to_f || 0.05) if 0 <= threshold_ham and threshold_ham <= threshold_spam and threshold_spam <= 1.0 @conf[THRESHOLD_HAM] = threshold_ham @conf[THRESHOLD] = threshold_spam @@ -118,7 +118,7 @@ EOT end def limit_of_submitted_pages - (@conf[LIMIT_OF_SUBMITTED_PAGES] || 50).to_i + (@conf[LIMIT_OF_SUBMITTED_PAGES].join.to_i || 50) end def submitted_pages_html