def add_abbreviation(source_text, replacement_text, match_suffix=False, timeout=<NUM_LIT:2>):
replacement = '<STR_LIT>'*(len(source_text)+<NUM_LIT:1>) + replacement_text<EOL>callback = lambda: write(replacement)<EOL>return add_word_listener(source_text, callback, match_suffix=match_suffix, timeout=timeout)<EOL>
Registers a hotkey that replaces one typed text with another. For example

    add_abbreviation('tm', u'™')

Replaces every "tm" followed by a space with a ™ symbol (and no space). The
replacement is done by sending backspace events.

- `match_suffix` defines if endings of words should also be checked instead
of only whole words. E.g. if true, typing 'carpet'+space will trigger the
listener for 'pet'. Defaults to false, only whole words are checked.
- `timeout` is the maximum number of seconds between typed characters before
the current word is discarded. Defaults to 2 seconds.

For more details see `add_word_listener`.