提取文本流中的单词。
npm i -g word-filter
wf -h
wf -n example/text
cat example/text | wf -n
const WordFilter = require('word-filter')
const fs = require('fs')
fs.createReadStream(__dirname + '/text')
.pipe(WordFilter.cjk())
.on('data', word => console.log(word))
Input
Don't repeat yourself.
笑相遇,似觉琼枝玉树相倚,暖日明霞光烂。
Do one thing and do it well.
在Node stream暴露的接口中,Readable和Writable分别需要实现_read和_write方法。
Output
笑
相
遇
似
觉
琼
枝
玉
树
相
倚
暖
日
明
霞
光
烂
在
暴
露
的
接
口
中
和
分
别
需
要
实
现
和
方
法