Joke Collection Website - Public benefit messages - Nodejs uses Jieba participle.

Nodejs uses Jieba participle.

It should be because of the update that there is something wrong with other people's tutorials online. I found it myself, and now I will share my income.

Npm installation node -jieba

document

Tell me about the problems I encountered during the installation. At first, I kept reporting errors, but it still didn't work. Then I upgraded python2.6.6 of centos6.3 to 2.7.3 and pip to the corresponding version in the document (1.3. 1), and then I installed it.

After installation, enter the node-jieba directory under node_modules in the project directory and run the install.sh statement as follows:

CD. /node_modules/node-jieba

sudo bash。 /install.sh

The specific usage document is very clear, and it should be noted that when running to

var analyzer = Jieba ({

Debugging: true

});

The python program of the plug-in will be started and can be used after use.

Analyzer. Close ()

Close python programs, but it takes time to start them, especially on low-performance computers (mine is the lowest-configured server in Alibaba Cloud, lasting 9.9 months). If you turn it off every time you use it, there will be a delay of about 1 second, and the experience will be affected. But it is always on, for fear of affecting the performance of the server. So just try it yourself and choose the way that suits you.