Skip to content

Instantly share code, notes, and snippets.

@ikr7
Created May 18, 2015 12:50
Show Gist options
  • Save ikr7/45b1a7e9df28f6549bcb to your computer and use it in GitHub Desktop.
Save ikr7/45b1a7e9df28f6549bcb to your computer and use it in GitHub Desktop.
var spawn = require('child_process').spawn;
var fs = require('fs');
var rs = fs.createReadStream('./kani.txt');
var mecab = spawn('/usr/local/bin/mecab');
// Read ストリーム --> MeCab --> 標準出力
// ってかんじでデータをわたしていく
rs.pipe(mecab.stdin);
mecab.stdout.pipe(process.stdout);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment