From 1b984bffa0dbc0aacbf37287c196e671db9c1229 Mon Sep 17 00:00:00 2001 From: Daniel Worley Date: Sat, 7 Mar 2020 19:07:25 -0500 Subject: [PATCH] Update default scorers with new params --- app/assets/javascripts/factories/ScorerFactory.js | 6 +++--- app/models/default_scorer.rb | 4 ++-- app/models/legacy/quepid_scorer.rb | 4 ++-- app/models/scorer.rb | 4 ++-- db/seeds.rb | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/assets/javascripts/factories/ScorerFactory.js b/app/assets/javascripts/factories/ScorerFactory.js index ce82a5d85..cfa982648 100644 --- a/app/assets/javascripts/factories/ScorerFactory.js +++ b/app/assets/javascripts/factories/ScorerFactory.js @@ -13,10 +13,10 @@ var defaultAlgorithm = [ '// Gets the average score over a scale of 100', '// (assumes query rating on a scale of 1-10)', - 'var score = avgRating100();', + 'var score = avgRating100(10);', 'if (score !== null) {', ' // Adds a distance penalty to the score', - ' score -= editDistanceFromBest();', + ' score -= editDistanceFromBest(10);', '}', 'setScore(score);', ].join('\n'); @@ -280,7 +280,7 @@ // works globally, not restricted to just search engine results, could be from 'Explain missing' function getBestRatings(count, bestDocs) { var bestDocsRatings = bestDocs.slice(0, count).map(function(x) {return x.rating;}); - + return bestDocsRatings; } diff --git a/app/models/default_scorer.rb b/app/models/default_scorer.rb index 61224ea7a..648ce209d 100644 --- a/app/models/default_scorer.rb +++ b/app/models/default_scorer.rb @@ -28,10 +28,10 @@ class DefaultScorer < ActiveRecord::Base code: [ '// Gets the average score over a scale of 100', '// (assumes query rating on a scale of 1-10)', - 'var score = avgRating100();', + 'var score = avgRating100(10);', 'if (score !== null) {', ' // Adds a distance penalty to the score', - ' score -= editDistanceFromBest();', + ' score -= editDistanceFromBest(10);', '}', 'setScore(score);' ].join("\n"), diff --git a/app/models/legacy/quepid_scorer.rb b/app/models/legacy/quepid_scorer.rb index 1c666a771..e1530026e 100644 --- a/app/models/legacy/quepid_scorer.rb +++ b/app/models/legacy/quepid_scorer.rb @@ -29,10 +29,10 @@ class QuepidScorer < ActiveRecord::Base code: [ '// Gets the average score over a scale of 100', '// (assumes query rating on a scale of 1-10)', - 'var score = avgRating100();', + 'var score = avgRating100(10);', 'if (score !== null) {', ' // Adds a distance penalty to the score', - ' score -= editDistanceFromBest();', + ' score -= editDistanceFromBest(10);', '}', 'setScore(score);' ].join("\n"), diff --git a/app/models/scorer.rb b/app/models/scorer.rb index 7dc815305..1f2c88b94 100644 --- a/app/models/scorer.rb +++ b/app/models/scorer.rb @@ -29,10 +29,10 @@ class Scorer < ActiveRecord::Base code: [ '// Gets the average score over a scale of 100', '// (assumes query rating on a scale of 1-10)', - 'var score = avgRating100();', + 'var score = avgRating100(10);', 'if (score !== null) {', ' // Adds a distance penalty to the score', - ' score -= editDistanceFromBest();', + ' score -= editDistanceFromBest(10);', '}', 'setScore(score);' ].join("\n"), diff --git a/db/seeds.rb b/db/seeds.rb index d9792c0a5..339b34ac9 100755 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -11,10 +11,10 @@ code: [ '// Gets the average score over a scale of 100', '// (assumes query rating on a scale of 1-10)', - 'var score = avgRating100();', + 'var score = avgRating100(10);', 'if (score !== null) {', ' // Adds a distance penalty to the score', - ' score -= editDistanceFromBest();', + ' score -= editDistanceFromBest(10);', '}', 'setScore(score);', ].join("\n"),