def titleVariations(title, fromPtdf=0):
 if fromPtdf:
  title1 = u''
 else:
  title1 = title
 title2 = title3 = u''
 if (fromPtdf or re_year_index.search(title)):
  titldict = analyze_title(title, canonical=1)
  title1 = titldict['title']
  if (titldict['kind'] != 'episode'):
   if fromPtdf:
    title3 = title
   else:
    title3 = build_title(titldict, canonical=1, ptdf=1)
  else:
   title1 = normalizeTitle(title1)
   title3 = build_title(titldict, canonical=1, ptdf=1)
 else:
  title1 = canonicalTitle(title)
  title3 = u''
 if title1:
  title2 = title1
  t2s = title2.split(u', ')
  if (t2s[(-1)].lower() in _unicodeArticles):
   title2 = u', '.join(t2s[:(-1)])
 _aux_logger.debug('title variations: 1:[%s] 2:[%s] 3:[%s]', title1, title2, title3)
 return (title1, title2, title3)

def titleVariations ( title , fromPtdf = 0 ) : if fromPtdf : title1 = u'' else : title1 = title title2 = title3 = u'' if ( fromPtdf or re_year_index . search ( title ) ) : titldict = analyze_title ( title , canonical = 1 ) title1 = titldict [ 'title' ] if ( titldict [ 'kind' ] != 'episode' ) : if fromPtdf : title3 = title else : title3 = build_title ( titldict , canonical = 1 , ptdf = 1 ) else : title1 = normalizeTitle ( title1 ) title3 = build_title ( titldict , canonical = 1 , ptdf = 1 ) else : title1 = canonicalTitle ( title ) title3 = u'' if title1 : title2 = title1 t2s = title2 . split ( u', ' ) if ( t2s [ ( - 1 ) ] . lower ( ) in _unicodeArticles ) : title2 = u', ' . join ( t2s [ : ( - 1 ) ] ) _aux_logger . debug ( 'title variations: 1:[%s] 2:[%s] 3:[%s]' , title1 , title2 , title3 ) return ( title1 , title2 , title3 )
build title variations useful for searches; if fromptdf is true .