Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A simple lookahead web service for use with AJAX in text box.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 Lev.py
Octocat-spinner-32 README
Octocat-spinner-32 animals.yaml
Octocat-spinner-32 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.