Example:
token_list = ['Allen Bradley', 'Haas', 'Fanuc']
input_string = 'I use Alln Brdly machins but dont no how to use Has ones.'
output_tokens = ['Allen Bradley', 'Haas']
Example:
token_list = ['Allen Bradley', 'Haas', 'Fanuc']
input_string = 'I use Alln Brdly machins but dont no how to use Has ones.'
output_tokens = ['Allen Bradley', 'Haas']
Using textdistance could help you find the distance of two words for examply by using the hamming distance.
This will return:
You should definitely look into the definition of the metric between two words as my given solution using, e.g. the hamming distance, can give deviating results for words of different lengths! The definition should only be applied to words of the same size. hamming distance
As my example uses the hamming distance as the words are expected to be equal a typo will only change the length by +-1 in most cases. Therefore, the usage of the hamming distance or the hamming similarity as used in textdistance should work in simple cases.