In 1392 Yi Seong-gye deposed the last king of Goryeo and raised his own dynasty; the Ming court conferred the name 'Joseon', and the capital settled at Hanyang (Seoul). Under Sejong the Great (1418-1450) the kingdom created Hunminjeongeum (1443), the native script later called Hangul, and produced a flowering of ritual, music and technology - the Nongsa jikseol agricultural treatise, rain gauges - while Confucian government and the yangban order matured. The Imjin War of 1592-1598, in which Ming armies helped Korea repel Toyotomi Hideyoshi's invasion, and the Manchu invasion of 1636, which forced vassalage to the Qing, twice devastated the country. Practical Learning (Silhak) then arose - Park Ji-won's Jehol diary is its classic - alongside the 18th-century reforms of Kings Yeongjo and Jeongjo. In the 19th century the Daewongun's seclusion policy collided with the reformists; the Treaty of Ganghwa opened the country in 1876, the Gabo reforms began in 1894, and in 1897 Gojong assumed the imperial title and re-named the state the Korean Empire, ending the Joseon dynastic name (Japan annexed Korea in 1910).