• Stars
    star
    458
  • Rank 92,879 (Top 2 %)
  • Language
    JavaScript
  • Created over 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A modern IDE for writing classical Chinese poetry 格律诗编辑程序

COPE - 格律诗编辑程序

Chinese Old Poem Editor - A modern IDE for writing classical Chinese poetry.

Features 功能

  • A tool for writing, editing, and managing user poems. 一个帮助创作、编辑、管理格律诗作品的工具
  • Automatically recognize tone patterns and detect errors. 自动检查平仄等格律规则。(失粘/失对/孤平/三平调/落韵)
  • Support for all 4 variations of 5-character and 7-character Jueju and Lüshi. 支持五七律绝的四种变格。
  • Built-in dictionaries. 内置韵书(平水韵/中华新韵)及康熙字典
  • Provide insights into user poems using data analysis. 机器学习分析用户作品并与《全唐诗》唐人诗句比对。

Installation 安装

Binaries

For macOS and Windows binaries, download the latest version on Releases page. 下载链接

Building

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.

Usage 使用

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.

Poem Analysis Tools 分析工具

You can see how your poem compares to those of Tang dynasty poets choosing from Analysis menu on the menu bar.

Bag-of-Words Embedding 词袋嵌入

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 B-O-W model: When used on 24153 poems of 64 most prolific poets of Tang Dynasty, a classifier powered by finding nearest-neighbor of B-O-W vectors gives a Top-1 accuracy of 33.4%, Top-5 accuracy of 65.6%, and Top-10 accuracy of 79.8%.)

上图为在李商隐《杜工部座中离席》上的运行结果,该诗应为义山模仿杜甫风格的作品。算法运行结果显示两人皆在此诗风格相似度前十之内。 上图为在李商隐《韩碑》上的运行结果,该诗应为义山模仿韩愈风格的作品。算法运行结果显示两人皆在此诗风格相似度前十之内。

Line-wise Nearest Neighbor 逐句近邻

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.

上图为在清人黄景仁《绮怀》诗上的运行结果,该诗前两联应为化用李义山,为算法正确发掘。

Markov Chain Edit Suggestions 自动补全

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.

TODO

  • More data analysis tools
  • Support for 词/曲
  • More file options: managing notebooks, import/export etc.

All suggestions and pull requests are welcome!

More Repositories

1

shan-shui-inf

Procedurally generated Chinese landscape painting.
HTML
5,464
star
2

fishdraw

procedurally generated fish drawings
JavaScript
2,197
star
3

qiji-font

齊伋體 - typeface from Ming Dynasty woodblock printed books
Python
1,245
star
4

rrpl

Describing Chinese Characters with Recursive Radical Packing Language (RRPL)
JavaScript
846
star
5

linedraw

Convert images to vectorized line drawings for plotters.
Python
744
star
6

wax

A tiny programming language that transpiles to C, C++, Java, TypeScript, Python, C#, Swift, Lua and WebAssembly 🚀
C
730
star
7

q5xjs

A small and fast alternative (experimental) implementation of p5.js
JavaScript
526
star
8

nonflowers

Procedurally generated paintings of nonexistent flowers.
JavaScript
503
star
9

skeleton-tracing

A new algorithm for retrieving topological skeleton as a set of polylines from binary images
C
488
star
10

ndwfc

🌊💥 N-dimensional Wave Function Collapse with infinite canvas
JavaScript
308
star
11

psvg

Programmable Scalable Vector Graphics -- drawings that draw themselves
TypeScript
297
star
12

legumes

🎼 A sheet music to polylines renderer
TypeScript
230
star
13

magic-square-poems

Discovering magic squares in Tang Dynasty poems
C
188
star
14

handpose-facemesh-demos

🎥🤟 8 minimalistic templates for tfjs mediapipe handpose and facemesh
JavaScript
185
star
15

Hermit

A man. A horse. A nature.
Python
167
star
16

Processing-Demos-for-The-Pocket-Handbook-of-Image-Processing-Algorithms

Processing Demos made when reading the book *The Pocket Handbook for Image Processing Algorithms in C*
Processing
127
star
17

chinese-hershey-font

Convert Chinese Characters to Single-Line Fonts using Computer Vision
Python
123
star
18

edges2calligraphy

Using pix2pix to convert scribbles to Chinese calligraphy
JavaScript
114
star
19

tk-fangsong-font

剔骨仿宋: Experimental Fang Song style Chinese font
Python
111
star
20

grand-timeline

Interactive grand unified timeline of 30,800 ancient Chinese people / 古人全表
JavaScript
109
star
21

hfmath

Render LaTeX math with Hershey Fonts
TypeScript
91
star
22

wechit

WeChat in Terminal (微信终端版)
Python
88
star
23

VisionOSC

PoseOSC + FaceOSC + HandOSC + OcrOSC + CatOSC + DogOSC
Objective-C++
85
star
24

wasm-fun

Non-trivial programs in hand-written WebAssembly
WebAssembly
77
star
25

PoseOSC

📹🤸‍♂️🤾‍♀️🤺 PoseNet + OSC: send realtime human pose estimation data to your apps
JavaScript
76
star
26

ci-ren

Generative Chinese poetry
Python
74
star
27

r1b

A thermal-printer-oriented, 1-bit graphics rasterizer for 2D and 3D
C
70
star
28

squiggy

vector brushstroke library
TypeScript
63
star
29

asciimare

3D engine powered by ASCII art
Python
61
star
30

Okb.js

Procedural generation toolkit for Javascript - noises, randomness, curves, and more
HTML
58
star
31

ofxPoissonFill

Poisson filling shader for OpenFrameworks
C++
56
star
32

p5-hershey-js

p5.js Hershey Vector Font Library
JavaScript
50
star
33

pmst

🎨 Poor Man's Style Transfer - Painting an image with the style of another, without machine learning
C++
48
star
34

zdic-cli

An offline command-line interface to zdic.net dictionary (漢典)
JavaScript
47
star
35

interesting-polygon-archive

Collection of polygon data in various formats for testing computational geometry algorithms.
Processing
46
star
36

Loshu.js

A linear algebra library for JavaScript 🔢
JavaScript
46
star
37

skeletonization-js

Javascript implementation of image skeletonization
JavaScript
41
star
38

ttf2hershey

Convert True Type Fonts (.ttf) to Hershey vector fonts
Python
40
star
39

fv

An experimental approach to expressing vector math in js (tagged template literals)
JavaScript
30
star
40

t43

A tiny 3D slicer written from scratch
C
30
star
41

LingDong-

Automatically keep my Github profile README updated with a python script and Github Actions
Python
28
star
42

PContour

Processing/Java library for finding contours in binary images
HTML
27
star
43

srcsnap

screenshot-driven version tracking
JavaScript
21
star
44

dbn.js

Recreation of John Maeda's "Design By Numbers" programming environment in JavaScript
JavaScript
17
star
45

TrackpadOSC

💻👋✌️👉Send mac's multitouch trackpad read-out through OSC
Objective-C
17
star
46

xcessing

Friendly Processing-like interface to X11/Xlib in C
C
16
star
47

wax4vscode

Extension for the wax programming language in VS Code (highlight + transpile + run)
TypeScript
15
star
48

svg2pl

convert svg to polylines
C
14
star
49

lbll

tiny experimental language for limited environments
C
14
star
50

fast-many-face-detection-with-cpp-or-openframeworks-on-mac-using-neural-networks

Fast Many Face Detection with C++/OpenFrameworks on macOS using Neural Networks
C++
14
star
51

machining-projection-map

JavaScript
8
star
52

avrlass

AVR Lightweight Assembler (and disassembler)
JavaScript
6
star
53

60-212

JavaScript
5
star
54

teapot.lua

1 path tracer written in pure lua, 1 file, 0 dependencies.
Lua
5
star
55

Hello-World

Lorem Ipsum
3
star
56

cvDictUI

opencv-python tool for generating interactive GUI from any python dictionary
Python
3
star
57

lingdong

LingDong's project links
JavaScript
2
star