Coder Social home page Coder Social logo

mmseg-node's Introduction

mmseg

A nodeJS driver for libmmseg

Install libmmseg

###libmmseg on ubuntu

apt-get install make gcc g++ automake libtool
wget http://www.coreseek.cn/uploads/csft/3.2/mmseg-3.2.14.tar.gz
tar zxvf mmseg-3.2.14.tar.gz 
cd mmseg-3.2.14
./bootstrap 
./configure
make && make install
#Install libmmseg on ubuntu

###libmmseg on mac os

sudo port install autoconf263 libtool-devel m4 autoconf automake libtool
wget http://www.coreseek.cn/uploads/csft/3.2/mmseg-3.2.14.tar.gz
tar zxvf mmseg-3.2.14.tar.gz 
cd mmseg-3.2.14
aclocal &&  glibtoolize --copy --force --ltdl && autoreconf -i -f && automake --a && ./configure  && make && sudo make install

###Other system

Please check the official install document

Install mmseg-node

#Install mmseg-node with npm
#Set the os env MMSEG_PATH if you configure libmmseg with --prefix
#export MMSEG_PATH=/usr/local/mmseg3
npm install mmseg

##Usage

var mmseg = require("mmseg");
var q = mmseg.open('/usr/local/etc/');
console.log(q.segmentSync("我是中文分词"));

License

(The MIT License)

Copyright (c) 2011 Hidden <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

mmseg-node's People

Contributors

arronzhang avatar simsicon avatar wptad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mmseg-node's Issues

yosemite编译不通过

rt, 报错信息:In file included from css/ThesaurusDict.cpp:6: ../src/css/ThesaurusDict.h:12:17: error: expected namespace name,按照官网上的安装方法也不行。。

关于libmmseg的效率和API的便捷性

你好。因为你没有留邮件,只好给你发一个ticket了。

我自己也实现了一个纯Js的mmseg分词,并且API的设计也适应于Node的异步回调方式。
https://github.com/mountain/nseg

我对你的包和我的实现做了一个测试,切分一个长文本一百次:
https://github.com/mountain/nseg/blob/master/perfs/perftest.js

  • mmseg同步方式大概可以跑到70万次分词每秒;
  • 而我的包,异步方式跑,也可以很快完成所有切分,速度大概在23万次每秒;但由于我写测试方式的原因,它不断销毁异步调用的context,最终返回主程序并退出的时间会比较久。

我看到你方法命名是Sync结尾的。不知道你对异步调用是怎么考虑的?

大家多多切磋。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.