Skip to content

Commit

Permalink
Update default scorers with new params
Browse files Browse the repository at this point in the history
  • Loading branch information
worleydl committed Mar 8, 2020
1 parent 5f9af1e commit 1b984bf
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions app/assets/javascripts/factories/ScorerFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions app/models/default_scorer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
4 changes: 2 additions & 2 deletions app/models/legacy/quepid_scorer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
4 changes: 2 additions & 2 deletions app/models/scorer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
4 changes: 2 additions & 2 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit 1b984bf

Please sign in to comment.