NodeJieba只是CppJieba简单包装而成的node扩展,用来进行中文分词。
npm install nodejieba
mkdir nodejieba_test
cd nodejieba_test
npm install nodejieba
echo "var segment = require(\"nodejieba\");
segment.loadDict(\"./node_modules/nodejieba/dict/jieba.dict.utf8\", \"./node_modules/nodejieba/dict/hmm_model.utf8\");
console.log(segment.cut(\"你好世界\"));" > index.js
node index.js
在node v0.10.2
下测试通过