Created
January 7, 2023 10:01
-
-
Save ozcanyarimdunya/734f32626265f245b081674ea4cd7e96 to your computer and use it in GitHub Desktop.
did you mean ?, n closest match
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import difflib | |
matches = difflib.get_close_matches( | |
word="ozc", | |
possibilities=[ | |
"ozcan", | |
"ozca", | |
"zcan", | |
"stat", | |
], | |
n=5, | |
cutoff=0.5 | |
) | |
print(matches) | |
# ['ozca', 'ozcan', 'zcan'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment