Fix ranking issues
This commit is contained in:
parent
eccace4f51
commit
18e97cf677
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue