Parsing and generating Hanyu Pinyin with SWI-Prolog