def nameScore(name, year, preferred_words):
 try:
  score = 0
  name = name.lower()
  for value in name_scores:
   v = value.split(':')
   add = int(v.pop())
   if (v.pop() in name):
    score += add
  if (str(year) in name):
   score += 5
  nzb_words = re.split('\\W+', simplifyString(name))
  score += (100 * len(list((set(nzb_words) & set(preferred_words)))))
  return score
 except:
  log.error('Failed doing nameScore: %s', traceback.format_exc())
 return 0

def nameScore ( name , year , preferred_words ) : try : score = 0 name = name . lower ( ) for value in name_scores : v = value . split ( ':' ) add = int ( v . pop ( ) ) if ( v . pop ( ) in name ) : score += add if ( str ( year ) in name ) : score += 5 nzb_words = re . split ( '\\W+' , simplifyString ( name ) ) score += ( 100 * len ( list ( ( set ( nzb_words ) & set ( preferred_words ) ) ) ) ) return score except : log . error ( 'Failed doing nameScore: %s' , traceback . format_exc ( ) ) return 0
calculate score for words in the nzb name .