lei-poem-bot
v1.1.2
Published
A bot who writes poems intelligently
Downloads
2
Readme
lei-poem-bot
English
Generate some poetry which imitated of YongLei
Description
The algorithm is relatively low-level. All the poems produced are recombined (copied) from the existing poems in the collection of Yonglei, but they CAN rhyme. The data covers all Chinese poems in Yonglei 1-1285.
Install
open your Terminal (or Cmd in Windows), then run this below
// global installation
// ! sometimes you should run as admin.
npm i -g lei-poem-bot
then
leipoem -V
where it will show you the version. That means you've successfully installed it !
Usage
open your Terminal (or Cmd in windows), then run
leipoem
it will show you a quatrains with seven words each sentence such as
咏雷
春雷春雨创生机,
电子理论成传奇。
王侯将相能明瞭,
一腔赤血为真义。
Well done! Then try something advanced. Run
leipoem 5/8
You'll get a metrical poem with five words each sentence such as
咏雷
单刀赴会雷绍武,不觉夕阳已黄昏。
定是一片新山河,多么伟大的理论。
有礼有节吐芳华,九岁钻研如鹰隼。
雷声一鸣天地震,雷氏理论永留存。
and more examples:
leipoem 5/4 // a quatrains with five words each sentence
leipoem 4/8 // a metrical poem with four words each sentence
...
You can follow this law and try more,we offer an command of leipoem -h
to show the brief usage too.
What's more, do remenber that it ONLY support args as x/4
or x/8
, you know why~
Possible problems
- Plagiarism (well, this is not "possible" at all, but "100% existing". This problem cannot be solved before the improvement of algorithm and data source ╮ ( ̄▽  ̄ "") ╭);
- Occasionally (very occasionally) encounter bad rhyme;
- The tonality of rhythmic poetry is wrong. (flat and tonal analysis has not been introduced yet, but these metrical poems are reading well... However, due to this influence, the function of ci filling has not been developed yet);
- the bot which is meant to admire Lei will occasionally become an anti one. For example
Spread all of the world Lei is the leader, while killed at first with a blast of thunder.
Todo
- Expand writable genres (such as three and a half sentences);
- Introduce of flat and tonal analysis, so that you can choose tones to fill ci;
- Expand the data source, so as not to copy all the poems in everyone's collection of Yonglei (but it's too difficult to add intelligent semantic analysis);
- I won't change the anti-Lei bug. However, even if I'd intend to do so, I can't change it without semantic analysis.
简体中文
根据《咏雷集》自动生成押韵的咏雷诗。
介绍
算法低级,全部采用现存《咏雷集》中的诗句重新组合(抄袭),但是可以押韵。数据涵盖量:咏雷1-1285中所有的中文诗句。
安装
打开终端(或Windows中的Cmd命令行),执行如下命令
// 全局安装
// 注意:安装报错时请尝试切换到管理员模式
npm i -g lei-poem-bot
再执行如下命令
leipoem -V
如果显示了版本号,说明安装成功。
用法
打开终端(或Windows中的Cmd命令行),执行如下命令
leipoem
不出意外会显示一首七言绝句,例如:
咏雷
春雷春雨创生机,
电子理论成传奇。
王侯将相能明瞭,
一腔赤血为真义。
你当然可以尝试进阶用法
leipoem 5/8
你可以得到一首五言律诗,例如
咏雷
单刀赴会雷绍武,不觉夕阳已黄昏。
定是一片新山河,多么伟大的理论。
有礼有节吐芳华,九岁钻研如鹰隼。
雷声一鸣天地震,雷氏理论永留存。
更多例子
leipoem 5/4 // a quatrains with five words each sentence
leipoem 4/8 // a metrical poem with four words each sentence
...
发现规律了吗?可以按照规律多多尝试。我们还提供了一个 leipoem -h
命令来展示使用简介。
值得注意的是,参数只支持 x/4
或 x/8
类型的,因为目前只支持绝句和律诗。
可能存在的问题:
- 抄袭(这个根本就不是「可能存在」,是「100%存在」,此问题在算法和数据来源改进之前都不可能解决好吗╮( ̄▽ ̄"")╭);
- 偶尔(非常偶尔)遇到押韵不好的情况;
- 律诗的平仄不对。(还没引入平仄分析,但是这些律诗读着还不错。。。不过受此影响,填词功能还没开发);
- 智障Bot偶尔会变成反雷。例如:
雷力存心走天涯,一声炸雷劈死它。
Todo
- 拓展可写的体裁(比如三句半等);
- 引入平仄分析,从而可以选词牌填词;
- 拓展数据来源,不至于全部抄大家的咏雷集里的诗词(不过不打算加入智能语义分析,太难太难的);
- 反雷的bug我是不会改的。当然,没有语义分析我也改不了。