A template engine generates a context-sensitive text message corresponding to an input text string. The input text string is first decomposed into a set of search words. The template engine then uses those search words to search a database of predefined templates to identify a template that is contextually appropriate for the input text string. The identified template may then be used to generate a responsive text message. The template engine is also able to "learn," dynamically updating the template database to reflect user preferences with respect to templates identified by the template engine as being contextually appropriate for particular search words.