An Emacs Input Method extension for smart pinyin