I'm customizing the 404 page for my website. I'd like it to include a "Did you mean...?" I need to figure out how to do this.
Here's what I'm doing so far: I come up with a broad list of files that the user might be looking for, then use levenshtein() to compare each possible filename to the mistyped filename. Those with the lowest differences are selected for "Did you mean."
I've also considered using metaphone(), but I think it may be excessive.
What would you suggest for a "Did you mean...?" script?