From 18e97cf6775c3b3f735cb03ee5c36c7cbed6e3c2 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sat, 12 Mar 2016 18:15:07 +0000 Subject: [PATCH] Fix ranking issues --- build-data/BuildData.groovy | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/build-data/BuildData.groovy b/build-data/BuildData.groovy index 8a985867..f987d63a 100755 --- a/build-data/BuildData.groovy +++ b/build-data/BuildData.groovy @@ -88,16 +88,11 @@ def getNamePermutations(names) { def out = names*.trim().unique().collectMany{ original -> def s = original.trim() - s = s.replaceAll(/([,]\s(The|A)$)/, '').trim() + s = s.replaceAll(/([,]\s(The|A)$)/, '') s = s.replaceAll(/\s&\s/, ' and ') s = s.replaceAll(/\s\([^\)]*\)$/, '').trim() - - // e.g. The Walking Dead => Walking Dead, The Voice => The Voice - def sn = s.replaceAll(/^(?i:The|A)\s/, '').trim() - if (sn ==~ /\w+/) { - return [original, s] - } - return [original, sn] + s = s.replaceAll(/^(?i:The|A)\s/, '').trim() + return [original, s] }.unique{ normalize(it) }.findAll{ it.length() > 0 } out = out.findAll{ it.length() >= 2 && !(it ==~ /[1][0-9][1-9]/) && !(it =~ /^[a-z]/) && it =~ /^[@.\p{L}\p{Digit}]/ } // MUST START WITH UNICODE LETTER