Don't add non The|A alias titles if what remains is a single word (e.g. The Voice VS Voice)

This commit is contained in:
Reinhard Pointner 2016-03-12 10:47:39 +00:00
parent e8c05b86fc
commit 95f2e38e9e
1 changed files with 1 additions and 1 deletions

View File

@ -83,7 +83,7 @@ def isValidMovieName(s) {
def getNamePermutations(names) { def getNamePermutations(names) {
def normalize = { s -> s.toLowerCase().normalizePunctuation() }.memoize() def normalize = { s -> s.toLowerCase().normalizePunctuation() }.memoize()
def fn1 = { s -> s.replaceAll(/(?i)(^(The|A)\s)|([,]\s(The|A)$)/, '') } def fn1 = { s -> def n = s.replaceAll(/(?i)(^(The|A)\s)|([,]\s(The|A)$)/, ''); s =~ /^(?i:The|A)/ && n ==~ /\w+/ ? s : n } // e.g. The Walking Dead => Walking Dead, The Voice => The Voice
def fn2 = { s -> s.replaceAll(/\s&\s/, ' and ') } def fn2 = { s -> s.replaceAll(/\s&\s/, ' and ') }
def fn3 = { s -> s.replaceAll(/\([^\)]*\)$/, '') } def fn3 = { s -> s.replaceAll(/\([^\)]*\)$/, '') }