Spellcheck
Pagefind does not currently provide a spellcheck, to keep the network resource size down. Proposal:
- Identify high-value unique words on the site
- Add those words into the metadata index
- Provide spellcheck amongst that set of results
Perhaps implement using the Damerau–Levenshtein metric and distribute the feature as part of an extension pack to keep the core service as small as possible.
Can https://github.com/wolfgarbe/SymSpell approach be useful here? The core idea is to use delete operations only instead of traditional: delete, insert, replace, transpose (Damerau–Levenshtein distance).
It produces all variations from the word with delete operation. So for word page (with distance 1): age, pge, pae, pag. And then let's assume we have word with typo - paeg, we need to produce all words with with delete operation of distance 1: aeg, peg, pag, pae. If there are common words in both sets (pag, pae) then second word can be considered as misspelling of the first one