def normalizeTitle(title, lang=None):
 isUnicode = isinstance(title, unicode)
 stitle = title.split(', ')
 articlesDicts = linguistics.articlesDictsForLang(lang)
 if ((len(stitle) > 1) and (stitle[(-1)].lower() in articlesDicts[isUnicode])):
  sep = ' '
  if (stitle[(-1)][(-1)] in ("'", '-')):
   sep = ''
  if isUnicode:
   _format = u'%s%s%s'
   _joiner = u', '
  else:
   _format = '%s%s%s'
   _joiner = ', '
  title = (_format % (stitle[(-1)], sep, _joiner.join(stitle[:(-1)])))
 return title

def normalizeTitle ( title , lang = None ) : isUnicode = isinstance ( title , unicode ) stitle = title . split ( ', ' ) articlesDicts = linguistics . articlesDictsForLang ( lang ) if ( ( len ( stitle ) > 1 ) and ( stitle [ ( - 1 ) ] . lower ( ) in articlesDicts [ isUnicode ] ) ) : sep = ' ' if ( stitle [ ( - 1 ) ] [ ( - 1 ) ] in ( "'" , '-' ) ) : sep = '' if isUnicode : _format = u'%s%s%s' _joiner = u', ' else : _format = '%s%s%s' _joiner = ', ' title = ( _format % ( stitle [ ( - 1 ) ] , sep , _joiner . join ( stitle [ : ( - 1 ) ] ) ) ) return title
return the title in the normal "the title" format; beware that it doesnt handle long imdb titles .