npm install chinesegenLorem Ipsum generator for Chinese
It can generate words randomly including punctuation marks in Chinese
中文随机文本生成器
可以用来测试你的中文文字处理库或者程序,也可以用来测试你的可视化页面。
shell
npm install chinesegen
`API Usage Guidelines
- require Chinese generator
`javascript
var chinesegen = require('chinesegen');
`- get the output object by calling the generator
`javascript
var generated = chinesegen({count: 50});
`- access generated text and infos
`javascript
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
`javascript
// treat both Chinese formal periods and '?.!' as full stops of the Chinese sentences
generate({count: 50, toleratedPeriods:'?.!'});
`` random text
生成的随机文本
- total: { _Number_ }
text total length
生成的文字总长度
- sentenceCount: { _Number_ }
sentence count
句子数