From 722ec11324477c4110053a98c98ef19d1e7301ba Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Sun, 27 Oct 2013 12:50:54 +0100 Subject: [PATCH] improved artist's name matching --- lib/match.js | 49 ++++++++++++++++++++++++++++++++----------------- package.json | 2 +- 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/lib/match.js b/lib/match.js index 36c1776..7dddce4 100644 --- a/lib/match.js +++ b/lib/match.js @@ -82,29 +82,44 @@ module.exports = function(subject, guess, enableartistrules) { } if (enableartistrules) { - // Ignore "the" at the beginning of artist name - if (/^the /.test(subject)) { - var nothe = subject.replace(/^the /, ''); - if (checkDistance(nothe, guess, threshold)) { - return true; - } - if (/jimi hendrix experience/.test(nothe) && - checkDistance(nothe.replace(/ experience/, ''), guess, threshold)) { - return true; - } - } // Split artist name on " & " and ", " (artist name can be composed by more names) - var splitted = subject.split(/ & |, /); - if (splitted.length !== 1) { - for (var i=0; i