Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
AAvTech => AAvTech
THe => The
imho => IMHO
"""
if word.istitle():
return correction.title()
if word.isupper():
return correction.upper()
if correction == word and not word.islower():
return word
if len(word) > 2 and word[:2].isupper():
return correction.title()
if not known_as_lower([correction]): #expensive
try:
return CASE_MAPPED[correction]
except KeyError:
pass
return correction