add wordcount

pull/83/head
Jimmy Song 2017-11-30 19:11:22 +08:00
parent 08171d11f5
commit 5e7ea69e56
2 changed files with 17 additions and 1 deletions

View File

@ -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
```

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Count Chinese characters # Count Chinese characters
total=0 total=0
basedir="../" basedir="../../"
for x in `cd $basedir;fd -e md` for x in `cd $basedir;fd -e md`
do do
i=`cnwordcount -f $basedir/$x|cut -d " " -f2` i=`cnwordcount -f $basedir/$x|cut -d " " -f2`