<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def function(self, function_name, word):
 """ Apply a function on given word :param str function_name: function to apply :param str word: word to apply function on :rtype: Query """

        word = self._parse_filter_word(word)

        self._add_filter(
            *self._prepare_function(function_name, self._attribute, word,
                                    self._negation))
        return self