The function applies its rule to all words, but it does not hold for words that are not nouns. For example, if I try "running" (a verb), the function returns "the act of running" instead of adding a phrase to the end. So, the domain of the function is nouns.

I hope that helps! Let me know if you have any other questions or if you'd like me to run more experiments.