Make suggestions order stable [Bug #16263]
As the result order of `DidYouMean::SpellChecker#correct` is undefined, keep the order of the original candidates.
This commit is contained in:
parent
71ffe40a44
commit
263ee6639d
@ -1787,7 +1787,7 @@ XXX
|
|||||||
end
|
end
|
||||||
all_candidates.select! {|cand| cand.is_a?(String) }
|
all_candidates.select! {|cand| cand.is_a?(String) }
|
||||||
checker = DidYouMean::SpellChecker.new(dictionary: all_candidates)
|
checker = DidYouMean::SpellChecker.new(dictionary: all_candidates)
|
||||||
DidYouMean.formatter.message_for(checker.correct(opt))
|
DidYouMean.formatter.message_for(all_candidates & checker.correct(opt))
|
||||||
end
|
end
|
||||||
|
|
||||||
def candidate(word)
|
def candidate(word)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user