0.3.3 • Published 10 years ago

chinesegen v0.3.3

Weekly downloads
7
License
MIT
Repository
github
Last release
10 years ago

chinesegen

npm version Build status

Lorem Ipsum generator for Chinese It can generate words randomly including punctuation marks in Chinese

中文随机文本生成器

Usages

  • sources for testing your word process libs or apps
  • sources for testing your visualized pages or apps

可以用来测试你的中文文字处理库或者程序,也可以用来测试你的可视化页面。

Installation

npm install chinesegen

API Usage Guidelines

  • require Chinese generator
  var chinesegen = require('chinesegen');
  • get the output object by calling the generator
  var generated = chinesegen({count: 50});
  • access generated text and infos
  console.log(generated.text);
  console.log(generated.sentenceCount);

Input options

  • count: { Number }

    the total word count of the generated paragraph 篇幅字数总长

  • freq: { Boolean }

    apply frequently used words 允许常用字

  • toleratedPeriods: { String }

    given characters(each represents one period) will be treated as unique periods appended to Chinese periods list

      // treat both Chinese formal periods and '?.!' as full stops of the Chinese sentences
      generate({count: 50, toleratedPeriods:'?.!'});

    允许其他字符作句号

Output object

  • text: { String }

    random text 生成的随机文本

  • total: { Number }

    text total length 生成的文字总长度

  • sentenceCount: { Number }

    sentence count 句子数

License

MIT License

0.3.3

10 years ago

0.3.1

10 years ago

0.2.1

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago