Function Signature:
get_close_matches(word, possibilities, n, cutoff)
Parameters:
word – a Python string for which close matches to be found
possibilities - A sequence containing Python strings from which close matches to be found
n – Number of close matches to be found
cutoff - The similarity score using which the close matches to be determined
Overview:
For a given word, the function get_close_matches() returns a specified number of close matches from a sequence of strings. e.g., From a list of strings.
Example:
|
# Example Python program that finds close matches # List of words # Word to be found for close matches # Get close matches print("Close matches:") |
Output:
|
List of words: |