From 5e7ea69e56d475cb1fb6de3e83ee6fa43c5d5fe7 Mon Sep 17 00:00:00 2001 From: Jimmy Song Date: Thu, 30 Nov 2017 19:11:22 +0800 Subject: [PATCH] add wordcount --- tools/wordcount/README.md | 16 ++++++++++++++++ tools/{ => wordcount}/wordcount.sh | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 tools/wordcount/README.md rename tools/{ => wordcount}/wordcount.sh (93%) diff --git a/tools/wordcount/README.md b/tools/wordcount/README.md new file mode 100644 index 000000000..151da519f --- /dev/null +++ b/tools/wordcount/README.md @@ -0,0 +1,16 @@ +# 全书字数统计 + +## 使用说明 + +首先需要安装`cnworcount`,见:https://github.com/rootsongjc/cnwordcount + +在该目录下执行: + +```bash +./wordcount +... +usecases/service-mesh.md 1306 +usecases/spark-standalone-on-kubernetes.md 285 +usecases/understanding-serverless.md 3481 +Total 136674 +``` \ No newline at end of file diff --git a/tools/wordcount.sh b/tools/wordcount/wordcount.sh similarity index 93% rename from tools/wordcount.sh rename to tools/wordcount/wordcount.sh index 04e4ce484..fc538a325 100755 --- a/tools/wordcount.sh +++ b/tools/wordcount/wordcount.sh @@ -1,7 +1,7 @@ #!/bin/bash # Count Chinese characters total=0 -basedir="../" +basedir="../../" for x in `cd $basedir;fd -e md` do i=`cnwordcount -f $basedir/$x|cut -d " " -f2`