def is_page_candidate(urlLink, urlTitle, title, artist):
 title = slugify(title.lower())
 artist = slugify(artist.lower())
 sitename = re.search(u'//([^/]+)/.*', slugify(urlLink.lower())).group(1)
 urlTitle = slugify(urlTitle.lower())
 if (urlTitle.find(title) != (-1)):
  return True
 tokens = (([((by + '_') + artist) for by in BY_TRANS] + [artist, sitename, sitename.replace('www.', '')]) + LYRICS_TRANS)
 songTitle = re.sub((u'(%s)' % u'|'.join(tokens)), u'', urlTitle)
 songTitle = songTitle.strip('_|')
 typoRatio = 0.9
 return (difflib.SequenceMatcher(None, songTitle, title).ratio() >= typoRatio)

def is_page_candidate ( urlLink , urlTitle , title , artist ) : title = slugify ( title . lower ( ) ) artist = slugify ( artist . lower ( ) ) sitename = re . search ( u'//([^/]+)/.*' , slugify ( urlLink . lower ( ) ) ) . group ( 1 ) urlTitle = slugify ( urlTitle . lower ( ) ) if ( urlTitle . find ( title ) != ( - 1 ) ) : return True tokens = ( ( [ ( ( by + '_' ) + artist ) for by in BY_TRANS ] + [ artist , sitename , sitename . replace ( 'www.' , '' ) ] ) + LYRICS_TRANS ) songTitle = re . sub ( ( u'(%s)' % u'|' . join ( tokens ) ) , u'' , urlTitle ) songTitle = songTitle . strip ( '_|' ) typoRatio = 0.9 return ( difflib . SequenceMatcher ( None , songTitle , title ) . ratio ( ) >= typoRatio )
return true if the url title makes it a good candidate to be a page that contains lyrics of title by artist .