Hunspell uses morphology internal to the dictionary to return ordered suggestions. You can modify the internal dictionary to change the way suggestions are returned.
In general, if you want to rank the suggestions after running Hunspell, you will need to choose a metric. Common metrics for individual tokens include Levenshtein and Hamming distance. These measure how much deviation there is from the token to each suggestions.
Modern approaches would likely use a contextual recommender where each suggestion is passed to a language model (e.g. BERT or something) and the score is the likelihood of that word in the context of the whole sentence. These can be more expensive to implement and come with some other challenges (i.e. making sure the context of the language model is appropriate).