Re: Sounds-like algorithm?

Michael Eager <[email protected]> Thu, 16 Jun 2022 09:26:20 -0700
Newsgroups gmane.org.user-groups.linux.svlug
Message-ID <[email protected]>
On 6/16/22 00:36, Steve Litt wrote:
> Hi all,
> 
> Well, once again my VSCode spellchecker stopped working. Aspell and
> Hunspell flagged every tag in my HTML. Spell checking in Vim was no
> help. Gedit and its better half Pluma flagged all the HTML.
> 
> Like it or not, I need to roll my own spellchecker. I always make my
> HTML be well-formed XML, so it was easy to use Python's
> xml.etree.ElementTree to parse everything and change only text that's a
> direct child of a <p></p> pair. Making a binary search to search my
> binary dictionary is no problem, nor is splitting up the paragraph into
> words to check. I've already put in the feature to word-wrap the
> yards-long paragraphs VSCode insists on making.
> 
> The only thing I don't know how to do is the sounds-alike algorithm to
> suggest other words. Has anybody made one of those? Or do you know of
> source code that's sound-alike algorithm and nothing but sounds-alike
> algorith without all sorts of X calls and other krap mixed in to
> obfuscate the actual algorithm?

https://en.wikipedia.org/wiki/Soundex

https://pypi.org/project/soundex/