Closed jtv199 closed 3 years ago
Sure! Take a look at how it's done in autocorrect_word in https://github.com/fsondej/autocorrect/blob/master/autocorrect/__init__.py First, you'd have to make a dict:
{'f': 'j',
'd': 'k',
...
And use it to generate candidates, so for 'cwwdee', you generate: 'cwwdee', 'cwwdei', cwwdie', ...
Speller.existing
can filter out non-existing words, and the line
return [(self.nlp_data.get(c, 0), c) for c in candidates]
Will give you word frequencies. You'd also need some way to handle ambiguities, like: 'cry' and 'cut'. Maybe while typing give user a list of alternative suggestions, sorted by frequency?
I'm curious how it works out.
It looks, you abandoned the idea, so I'm closing. If you decide to do it, reopen this issue.
Hi.
Mirrored QWERTY
I would like it for when I type a word such as "cwwdee" it can take into consideration of the mirrored QWERTY setup autocorrect it to "cookie"