Skip to content

Instantly share code, notes, and snippets.

@galvez

galvez/gist:57938

Created Feb 4, 2009
Embed
What would you like to do?
# ok, let's filter artist names based on bigram occurrence
bigrams = ss_vector[:6]
if len(bigrams) == 6:
like1 = '%%s%%s%%%s%' % (bigrams[0], bigrams[2], bigrams[4])
like2 = '%%s%%s%%%s%' % (bigrams[1], bigrams[3], bigrams[5])
db.execute('select a.id as artist_id, a.name as artist_name from artists a where a.name like %s;', (like1,))
likes1 = db.fetchall()
db.execute('select a.id as artist_id, a.name as artist_name from artists a where a.name like %s;', (like2,))
likes2 = db.fetchall()
uniq_likes = uniq(likes1+likes2, 'artist_id')
res['artists'] = _artists
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.