Approach to variant spellings is half-working
My plan to handle variant spellings is to create an AJAX routine that allows the user to retrieve a set of suggested variant spellings while on the search page, in order to allow them to see and select among candidates; this will also allow users to retrieve variant spellings without having to search.
After discovering that fuzzy-search is broken in eXist at the moment, I've found an implementation of Levenshtein Distance in XSLT by Jeni Tennison, which I've been able to re-purpose for my module, and that's working well. I have a complete system for tokenizing a search string and retrieving all the possible variant spellings, based on an analysis of all the <ref>
tags in the db. It's quite effective. It returns the variant list as plain text, which I plan to AJAX into an HTML5 <pre>
element on the page, so the user can copy/paste from there into the search box if that's what they want to do.
It's a bit complicated, and took me half the day to figure out, but it seems reasonably fast. I don't want to do variant-spelling searches by default, because that will considerably increase the burden for every search, and for most, it probably won't be necessary, so I like the two-stage solution.
Next I need to plug the AJAX stuff into it. I need a really small and efficient AJAX library -- want to avoid JQuery bloat if possible.