Classical Chinese is a written language that is based on Chinese as it was spoken in ancient times. It was standard for formal written communication until the 1920s. Knowledge of Classical Chinese was highly prized because it was tested by the Imperial Examinations. These examinations were used to select magistrates, called Mandarins. Classical Chinese was replaced by vernacular writing, or báihuà, which is based on the dialect of modern Beijing.