C hinese O ld P oem E ditor - A modern IDE for writing classical Chinese poetry.

For macOS and Windows binaries, download the latest version on Releases page. 下載鏈接
First, install node.js, including npm.
cd into the project directory, and type npm install . This will install all the dependencies.
Finally, npm start to run the app.

Click on left side of a cell to edit its contents. The tonal pattern hints will be shown on the right. Select rhyming dictionary and verse form from the tool bar. New cells will be automatically added once you filled up empty cells, or, you can manage them by clicking Cells from the menu bar. Add comments/title/attribution to your poem by preceding a line with a octothorpe ( # ). 
Before you fill in a character, its correct tonal pattern is shown on the right in the corresponding position. After you do so, a color-coded icon is shown on the upper right corner, indicating the tonal pattern of the character, and whether it is acceptable, along with a line pointing to the error message if it is not. The checker follows the general rule of "一三五不論", yet also ensures that "孤平" and "三平調" errors do not occur. The rhyme of the poem is automatically inferred, and checked agianst each character that needs to rhyme.

You can open the rhyming dictionary as well as Kang Xi dictionary by clicking on < button on the right side of the tool bar. Type a character in the search bar, and it will be highlighted if it is in the current rhyme group. Press Enter to jump to the rhyme group it belongs to. Click on a character in the group to show its definition in Kang Xi dictionary.
You can see how your poem compares to those of Tang dynasty poets choosing from Analysis menu on the menu bar.
A 1024D feature vector is generated for each of 256 Tang dynasty poets by applying bag-of-words model to their poems in Quan Tang Shi . A similar vector is generated for the user's poem. UMAP is used to reduce the dimension to 2, so the user can see where their poem lies in feature space among Tang dynasty poets. A list of nearest-neighbors are shown on the top left.
(Note on performance of the BOW model: When used on 24153 poems of 64 most prolific poets of Tang Dynasty, a classifier powered by finding nearest-neighbor of BOW vectors gives a Top-1 accuracy of 33.4%, Top-5 accuracy of 65.6%, and Top-10 accuracy of 79.8%.)
上圖為在李商隱《杜工部座中離席》上的運行結果,該詩應為義山模仿杜甫風格的作品。算法運行結果顯示兩人皆在此詩風格相似度前十之內。
上圖為在李商隱《韓碑》上的運行結果,該詩應為義山模仿韓愈風格的作品。算法運行結果顯示兩人皆在此詩風格相似度前十之內。
For each line in the user's poem, Quan Tang Shi is searched to find lines that are the most similar to it. This might help the user write better poems, as it shows how the great masters from the past delivered similar meanings.
上圖為在清人黃景仁《綺懷》詩上的運行結果,該詩前兩聯應為化用李義山,為算法正確發掘。
Characters that are not filled or violate tonal rules in the current poem are automatically replaced with suggested edits. Optionally uses 對偶/對仗. The poetry style (詩風) can also be selected from those of Tang Dynasty poets. Although this functionality can also be used to generate entire poems (and it does so pretty well), such use is not encouraged as it does not coincide with the purpose of the software as an editor. Check out this project of mine for a full Chinese poetry generator.
![]() | ![]() |
|---|---|
![]() | ![]() |
All suggestions and pull requests are welcome!