The function appears to apply the substitution rule to all input words, regardless of their origin or meaning. There is no apparent corruption in the domain of the function.

Please let me know if you would like me to test any additional words or if you have any further questions!