npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

lei-poem-bot

v1.1.2

Published

A bot who writes poems intelligently

Downloads

1

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

  1. Plagiarism (well, this is not "possible" at all, but "100% existing". This problem cannot be solved before the improvement of algorithm and data source ╮ ( ̄▽  ̄ "") ╭);
  2. Occasionally (very occasionally) encounter bad rhyme;
  3. 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);
  4. 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

  1. Expand writable genres (such as three and a half sentences);
  2. Introduce of flat and tonal analysis, so that you can choose tones to fill ci;
  3. 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);
  4. 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/4x/8 类型的,因为目前只支持绝句和律诗。

可能存在的问题:

  1. 抄袭(这个根本就不是「可能存在」,是「100%存在」,此问题在算法和数据来源改进之前都不可能解决好吗╮( ̄▽ ̄"")╭);
  2. 偶尔(非常偶尔)遇到押韵不好的情况;
  3. 律诗的平仄不对。(还没引入平仄分析,但是这些律诗读着还不错。。。不过受此影响,填词功能还没开发);
  4. 智障Bot偶尔会变成反雷。例如:

    雷力存心走天涯,一声炸雷劈死它。

Todo

  1. 拓展可写的体裁(比如三句半等);
  2. 引入平仄分析,从而可以选词牌填词;
  3. 拓展数据来源,不至于全部抄大家的咏雷集里的诗词(不过不打算加入智能语义分析,太难太难的);
  4. 反雷的bug我是不会改的。当然,没有语义分析我也改不了。