1
0
Fork 0
mirror of https://github.com/veekun/pokedex.git synced 2024-08-20 18:16:34 +00:00

Pokédex lookup now uses a whoosh index and spell-checker.

This commit is contained in:
Eevee 2009-07-25 01:28:33 -07:00
parent 8e08f88fd8
commit b13ffac247
3 changed files with 129 additions and 21 deletions

View file

@ -164,10 +164,14 @@ def lookup(engine_uri, name):
# XXX don't require uri! somehow
session = connect(engine_uri)
results = pokedex_lookup(session, name)
print "Matched:"
for object, matchiness in results:
print object.__tablename__, object.name, "(%.03f)" % matchiness
results, exact = pokedex_lookup(session, name)
if exact:
print "Matched:"
else:
print "Fuzzy-matched:"
for object in results:
print object.__tablename__, object.name
def help():