The function applies a simple mapping from words to their corresponding actions or categories.

