The function applies a simple substitution rule to each input word, replacing certain characters with a special character.

