Removed unused function

This commit is contained in:
YourFriendlyNeighborhoodDealer 2019-03-18 17:27:04 +01:00
parent e189f945de
commit 5b02f2494d

17
main.js
View file

@ -1553,23 +1553,6 @@ function AddVideoHotkeys(url) {
node.style.margin = "5px 5px 5px 5px"; // fancy margin node.style.margin = "5px 5px 5px 5px"; // fancy margin
} }
function GetMatchPercent(currData, questionParts) {
var currQuestion = SUtils.SimplifyQuery(currData.q); // current question simplified
var match = 0; // how many times the current question matches the current question in the database
for (var i = 0; i < questionParts.length; i++) // going through the question parts
{
if (currQuestion.includes(questionParts[i])) // if the current question from questionData includes one of the question parts
{
match++;
}
}
var percent = Math.round(((match / questionParts.length) * 100).toFixed(2)); // matched words percent
var lengthDifference = RemoveMultipleItems(SUtils.SimplifyQuery(currQuestion).split(" ")).length -
questionParts.length;
percent -= Math.abs(lengthDifference) * 2;
return percent;
}
// simple sort. // simple sort.
function SortByPercent(results) { function SortByPercent(results) {
for (var i = 0; i < results.length; i++) { for (var i = 0; i < results.length; i++) {