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:
parent
e8c05b86fc
commit
95f2e38e9e
|
@ -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(/\([^\)]*\)$/, '') }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue