How to check and correct misspelling in the data of pairs of words?
Another way to reframe the problem is approximate/fuzzy string matching. FuzzyWuzzy is an approximate/fuzzy string matching package for Python. The package can find the nearest element in a set to a user's inputted value with a level of confidence. Something like this:

from fuzzywuzzy import process

ports = {"Houston", "New York", "Newark", "Long Beach"}
user_input = "Strong Beach"
best_guess = process.extractOne(user_input, ports)
print(f"The best match for '{user_input}' is '{best_guess[0]}' which is a {best_guess[1]}% match.")



  The best match for 'Strong Beach' is 'Long Beach' which is a 82% match.