Skip to content
A simple lookahead web service for use with AJAX in text box.
Python
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
Lev.py
README
animals.yaml
motorbike_parts.yaml

README

Simple "look-ahead" word completion service using Levenshtein distance algorithm
to find closest matches. Meant to be used in conjunction with AJAX call in text
box.

REQUIRES: cherrypy, pyyaml

INSTALL: 
install cherrypy and pyyaml 

run ./Lev.py

Browse to localhost:8080

Comes with two example yaml files full of motorcycle parts and animals.

example lookup for "engine shroud" by typing "shroud"

http://localhost:8080/motorbike_parts/?word=s
["back rest", "foot peg", "handle bar", "seat", "spokes", "spring"]
http://localhost:8080/motorbike_parts/?word=sh
["leg shroud", "hub", "wind shield", "foot peg", "engine shroud", "back rest"]
http://localhost:8080/motorbike_parts/?word=shr
["wheel rim", "leg shroud", "engine shroud", "handle bar", "hub"]
http://localhost:8080/motorbike_parts/?word=shro
["engine shroud", "leg shroud", "hub", "back rest"]

It handles mispellings pretty well
http://localhost:8080/animals/?word=shrrew
["shrew", "ferret", "hare"]

Great fun to play with, and not particularly slow!
Something went wrong with that request. Please try again.