The function f(x) appears to be selecting for words that are related to animals, transportation, and fruits. It is not clear what the exact logic behind the function is, but it seems to be based on the semantic meaning of the input words.