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. #15
This commit is contained in:
parent
8e08f88fd8
commit
b13ffac247
3 changed files with 129 additions and 21 deletions
pokedex
|
@ -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():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue