pagefind icon indicating copy to clipboard operation
pagefind copied to clipboard

Spellcheck

Open bglw opened this issue 3 years ago • 2 comments

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

bglw avatar May 31 '22 00:05 bglw

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.

aretrace avatar Sep 04 '22 00:09 aretrace

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

stereobooster avatar Nov 23 '23 13:11 stereobooster