1. A method of classifying a user input, comprising: receiving a user input of Roman characters; determining that the user input includes an ambiguous word, the ambiguous word being a non-pinyin word written in the Roman characters and also being a valid pinyin input of one or more pinyin syllables; in response to determining that the user input includes an ambiguous word: classifying one or more words adjacent to the ambiguous word as belonging to a pinyin context or belonging to a non-pinyin context; classifying the ambiguous word as a pinyin input if the one or more words adjacent to the ambiguous word are classified as belonging to the pinyin context; and classifying the ambiguous word as a non-pinyin word if the one or more words adjacent to the ambiguous word are classified as belonging to the non-pinyin context.