Skip to content

Instantly share code, notes, and snippets.

@ozcanyarimdunya
Created January 7, 2023 10:01
Show Gist options
  • Save ozcanyarimdunya/734f32626265f245b081674ea4cd7e96 to your computer and use it in GitHub Desktop.
Save ozcanyarimdunya/734f32626265f245b081674ea4cd7e96 to your computer and use it in GitHub Desktop.
did you mean ?, n closest match
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