]> git.example.dev Git - binbsis50.git/commitdiff
added support for more abbreviations
authorLuigi Pinca <luigipinca@gmail.com>
Sun, 11 Jan 2015 10:46:34 +0000 (11:46 +0100)
committerLuigi Pinca <luigipinca@gmail.com>
Sun, 11 Jan 2015 10:46:34 +0000 (11:46 +0100)
lib/match.js
package.json

index 914724bd5fd9af7bdcb3798dc4bf676a8e839dcb..d1ef2568d2629a41d9ddfc9ca629d98866df03f5 100644 (file)
@@ -55,6 +55,18 @@ var checkDistance = function(s1, s2) {
   return d[s1.length][s2.length] <= k;
 };
 
+/**
+ * Supported artist name abbreviations.
+ */
+
+var abbreviations = {
+  ccr: 'creedence clearwater revival',
+  elo: 'electric light orchestra',
+  omd: 'orchestral manoeuvres in the dark',
+  rhcp: 'red hot chili peppers',
+  jsbx: 'the jon spencer blues explosion'
+};
+
 /**
  * Expose a function to check if the user answer is acceptable.
  */
@@ -132,13 +144,7 @@ module.exports = function(pattern, guess, enableartistrules) {
           }
         }
       }
-      if (guess === 'ccr' && artist === 'creedence clearwater revival') {
-        return true;
-      }
-      if (guess === 'elo' && artist === 'electric light orchestra') {
-        return true;
-      }
-      if (guess === 'omd' && artist === 'orchestral manoeuvres in the dark') {
+      if (guess in abbreviations && artist === abbreviations[guess]) {
         return true;
       }
     }
index 957ba604e7f61b1042e13d1070c4a7db6a26ab72..772464620bfefb4705f87aca44ba27a384104700 100644 (file)
@@ -35,5 +35,5 @@
     "start": "node app.js"
   },
   "subdomain": "binb",
-  "version": "0.5.4-1"
+  "version": "0.5.5"
 }