I have created an autocomplete function based on WordList.

auto = Autocomplete[WordList["KnownWords"]]

And if I use this on the letters "ga", it will provide me with a long list of possible words. Is it possible to create a probability list from these to choose the most commonly used one?

I am aware this is more of a theoretical question and am happy with any answers that point me in the right direction.


1 Answer 1



You can make use of WordFrequencyData and define


It will give you most popular hint, for examplle:




So starting from hints for say "gath"

auto = Autocomplete[WordList["KnownWords"]];
hints = auto["gath"]

{"gather", "gatherer", "gathered", "gathering"}

you can find and sort reversely their frequencies in typical English:



Then get already order hints as



or just the most frequent one




WordFrequencyData can slow down for too many words as it accesses Wolfram servers to download data and needs internet. One trick to speed this up - is to pre-download and save WordFrequencyData for your set of words. It might take a long time for many 1000s of words, but is doable if you split it in cycles by, say, 100 words.

  • $\begingroup$ Just to follow-up on how to speed it up, how can I pre-download certain words? $\endgroup$
    – Tim B
    Feb 1, 2020 at 20:27
  • 1
    $\begingroup$ @TimB prefetch = WordFrequencyData[{"cat", "dog"}] etc. then use prefetch variable to work with or save with Put Get etc. Read some docs on WordFrequencyData. $\endgroup$ Feb 1, 2020 at 21:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.