From c7cb47ec65730f8146613e7b6e566ffc4c08caa3 Mon Sep 17 00:00:00 2001 From: Chen Gong Date: Fri, 8 Feb 2019 15:50:49 +0800 Subject: [PATCH] test: script to generate pinyin input for performance test --- test/generate_pinyin_initials.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 test/generate_pinyin_initials.js diff --git a/test/generate_pinyin_initials.js b/test/generate_pinyin_initials.js new file mode 100644 index 000000000..c91920090 --- /dev/null +++ b/test/generate_pinyin_initials.js @@ -0,0 +1,7 @@ +const initials = 'bpmfdtnlgkhjqxzcsryw'; +const len = Number(process.argv[2]); +let t = []; +for (let i = 0; i < len; ++i) { + t.push(initials.charAt(Math.floor(Math.random() * initials.length))); +} +console.log(t.join(''));