{"_id":"node-segment","_rev":"7-02f26cfa6b36b3cc446dc15d9f811c94","name":"node-segment","description":"A Chinese word segmentation. 中文分词模块。","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.2":{"name":"node-segment","main":"./index.js","version":"0.0.2","description":"A Chinese word segmentation. 中文分词模块。","keywords":["segment","Chinese","中文分词"],"author":{"name":"Lei Zongmin","email":"leizongmin@gmail.com"},"contributors":[{"name":"Lei Zongmin","email":"leizongmin@gmail.com"}],"repository":{"type":"git","url":"git://github.com/leizongmin/node-segment.git"},"engines":{"node":">= 0.4.0"},"dependencies":{},"devDependencies":{"should":"*","mocha":">= 1.2","uglify-js":">= 1.3.3"},"scripts":{"test":"mocha -t 5000"},"directories":{"test":"test"},"license":"BSD","readme":"# 中文分词模块\n\n本模块以**[盘古分词组件](http://pangusegment.codeplex.com/)**中的词库为基础，\n算法设计也部分参考了盘古分词组件中的算法。\n\n在线演示地址：<http://segment.cnodejs.net/>\n\n1、使用方法\n========================\n\n```javascript\n// 载入模块\nvar Segment = require('node-segment').Segment;\n// 创建实例\nvar segment = new Segment();\n// 使用默认的识别模块及字典，载入字典文件需要1秒，仅初始化时执行一次即可\nsegment.useDefault();\n  \n// 开始分词\nconsole.log(segment.doSegment('这是一个基于Node.js的中文分词模块。'));\n```\n\n2、自定义识别\n=====================\n\n```javascript\n// 载入模块\nvar Segment = require('node-segment').Segment;\n// 创建实例\nvar segment = new Segment();\n// 配置，可根据实际情况增删，详见segment.useDefault()方法\nsegment.use('URLTokenizer');  // 载入识别模块，详见lib/module目录，或者是自定义模块的绝对路径\nsegment.loadDict('dict.txt'); // 载入字典，详见dicts目录，或者是自定义字典文件的绝对路径\n\n// 开始分词\nconsole.log(segment.doSegment('这是一个基于Node.js的中文分词模块。'));\n```\n\n授权\n===============\n\n基于MIT协议发布：\n\n    Copyright (c) 2012 Lei Zongmin(雷宗民) <leizongmin@gmail.com>\n    http://ucdok.com\n\n    The MIT License\n\n    Permission is hereby granted, free of charge, to any person obtaining\n    a copy of this software and associated documentation files (the\n    \"Software\"), to deal in the Software without restriction, including\n    without limitation the rights to use, copy, modify, merge, publish,\n    distribute, sublicense, and/or sell copies of the Software, and to\n    permit persons to whom the Software is furnished to do so, subject to\n    the following conditions:\n\n    The above copyright notice and this permission notice shall be\n    included in all copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n    LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n    OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n    WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"node-segment@0.0.2","dist":{"shasum":"0755f9164e7a15fd0fa123a35e194db70399d04e","tarball":"https://registry.npmjs.org/node-segment/-/node-segment-0.0.2.tgz","integrity":"sha512-gNMAD591N5PtnrObs+0LPq+zkhDh6guMnVT1K5WW+ytyS+KB16bwDi0jfgPr71iruJABkBhJzXmeqBK3q0E+FA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDo44obLE5wFXkhl+JFfwVQdY8WkfeJjwhwTQ+4ERHgsAIhAJniMA5aQLNDb8BePym6DS74jNF5xdz9IAMXuwUBcPk9"}]},"_npmVersion":"1.1.61","_npmUser":{"name":"dingcheng","email":"topren1@gmail.com"},"maintainers":[{"name":"dingcheng","email":"topren1@gmail.com"}]}},"readme":"# 中文分词模块\n\n本模块以**[盘古分词组件](http://pangusegment.codeplex.com/)**中的词库为基础，\n算法设计也部分参考了盘古分词组件中的算法。\n\n在线演示地址：<http://segment.cnodejs.net/>\n\n1、使用方法\n========================\n\n```javascript\n// 载入模块\nvar Segment = require('node-segment').Segment;\n// 创建实例\nvar segment = new Segment();\n// 使用默认的识别模块及字典，载入字典文件需要1秒，仅初始化时执行一次即可\nsegment.useDefault();\n  \n// 开始分词\nconsole.log(segment.doSegment('这是一个基于Node.js的中文分词模块。'));\n```\n\n2、自定义识别\n=====================\n\n```javascript\n// 载入模块\nvar Segment = require('node-segment').Segment;\n// 创建实例\nvar segment = new Segment();\n// 配置，可根据实际情况增删，详见segment.useDefault()方法\nsegment.use('URLTokenizer');  // 载入识别模块，详见lib/module目录，或者是自定义模块的绝对路径\nsegment.loadDict('dict.txt'); // 载入字典，详见dicts目录，或者是自定义字典文件的绝对路径\n\n// 开始分词\nconsole.log(segment.doSegment('这是一个基于Node.js的中文分词模块。'));\n```\n\n授权\n===============\n\n基于MIT协议发布：\n\n    Copyright (c) 2012 Lei Zongmin(雷宗民) <leizongmin@gmail.com>\n    http://ucdok.com\n\n    The MIT License\n\n    Permission is hereby granted, free of charge, to any person obtaining\n    a copy of this software and associated documentation files (the\n    \"Software\"), to deal in the Software without restriction, including\n    without limitation the rights to use, copy, modify, merge, publish,\n    distribute, sublicense, and/or sell copies of the Software, and to\n    permit persons to whom the Software is furnished to do so, subject to\n    the following conditions:\n\n    The above copyright notice and this permission notice shall be\n    included in all copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n    LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n    OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n    WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","maintainers":[{"name":"dingcheng","email":"topren1@gmail.com"}],"time":{"modified":"2022-06-21T21:29:03.290Z","created":"2012-10-17T04:30:09.052Z","0.0.2":"2012-10-17T04:30:09.790Z"},"author":{"name":"Lei Zongmin","email":"leizongmin@gmail.com"},"repository":{"type":"git","url":"git://github.com/leizongmin/node-segment.git"},"users":{"xufz":true,"sqrtthree":true}}