1 Star 0 Fork 624

mlc0202 / jcseg

forked from 狮子的魂 / jcseg 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

Jcseg[dʒɛ'​ke'sɛ]完整版本(源码, 词库, 帮助文档, 词库管理工具, jar文件)下载: http://sourceforge.net/projects/jcseg

一. 关于jcseg:

jcseg是使用Java开发的一个开源中文分词器,使用流行的mmseg算法实现,并且提供了最高版本的lucene, solr, elasticsearch(New)的分词接口.

1。目前最高版本:jcseg-1.9.5。兼容最高版本lucene-4.x,solr-4.x,elasticsearch

2。三种切分模式:

	(1).简易模式:FMM算法,适合速度要求场合。
	(2).复杂模式-MMSEG四种过滤算法,具有较高的岐义去除,分词准确率达到了98.41%。
	(3).(!New)检测模式:只返回词库中已有的词条,很适合某些应用场合。(1.9.4版本开始)

3。支持自定义词库。在lexicon文件夹下,可以随便添加/删除/更改词库和词库内容,并且对词库进行了分类。参考下面了解如何给jcseg添加词库/新词。

4。(!New) 支持词库多目录加载. 配置lexicon.path中使用';'隔开多个词库目录.

5。(!New)词库分为简体/繁体/简繁体混合词库: 可以专门适用于简体切分, 繁体切分, 简繁体混合切分, 并且可以利用下面提到的同义词实现,简繁体的相互检索, jcseg同时提供了词库两个简单的词库管理工具来进行简繁体的转换和词库的合并.

6。中英文同义词追加/同义词匹配 + 中文词条拼音追加.词库整合了《现代汉语词典》和cc-cedict辞典中的词条,并且依据cc-cedict词典为词条标上了拼音,依据《中华同义词词典》为词条标上了同义词(尚未完成)。更改jcseg.properties配置文档可以在分词的时候加入拼音和同义词到分词结果中。

7。中文数字和中文分数识别,例如:"一百五十个人都来了,四十分之一的人。"中的"一百五十"和"四十分之一"。并且jcseg会自动将其转换为阿拉伯数字加入到分词结果中。如:150, 1/40。

8。支持中英混合词和英中混合词的识别(维护词库可以识别任何一种组合)。例如:B超, x射线, 卡拉ok, 奇都ktv, 哆啦a梦。

9。更好的英文支持,电子邮件,域名,小数,分数,百分数,字母和标点组合词(例如C++, c#)的识别。

10。(!New)自定义切分保留标点. 例如: 保留&, 就可以识别k&r这种复杂词条。

11。(!New)复杂英文切分结果的二次切分: 可以保留原组合,同时可以避免复杂切分带来的检索命中率下降的情况,例如QQ2013会被切分成: qq2013/ qq/ 2013, chenxin619315@gmail.com会被切分成: chenxin619315@gmail.com/ chenxin/ 619315/ gmail/ com。

12。支持阿拉伯数字/小数/中文数字基本单字单位的识别,例如2012年,1.75米,38.6℃,五折,并且jcseg会将其转换为“5折”加入分词结果中。

13。智能圆角半角, 英文大小写转换。

14。特殊字母识别:例如:Ⅰ,Ⅱ

15。特殊数字识别:例如:①,⑩

16。配对标点内容提取:例如:最好的Java书《java编程思想》,‘畅想杯黑客技术大赛’,被《,‘,“,『标点标记的内容。(1.6.8版开始支持)。

17。智能中文人名识别。中文人名识别正确率达94%以上。(可以维护lex-lname.lex,lex-dname-1.lex,lex-dname-2.lex来提高准确率),(引入规则和词性后会达到98%以上的识别正确率)。

18。自动中英文停止词过滤功能(需要在jcseg.properties中开启该选项,lex-stopwords.lex为停止词词库)。

19。词库更新自动加载功能, 开启一个守护线程定时的检测词库的更新并且加载。

20。(!New)自动词性标注。

21。jcseg.properties --- 方便自主对分词进行配置, 打造适合你的应用的分词.

jcseg佩带了一个jcseg.properties文件,只要有使用文本编辑器你就可以自主的编辑里面的选项,配置适合不同场合的分词应用。例如:最大匹配词数,是否开启中文人名识别,是否记载词条拼音,是否载入词条同义词等等。 如何配置jcseg

二. 分词速度:

测试环境:2.8GHZ/2G/Ubuntu

Simple 模式: 1366058字/秒 3774.5KB/秒

Complex 模式: 479338字/秒 1324.4KB/秒

分词测试:

文本一:

歧义和同义词:研究生命起源,混合词: 做B超检查身体,x射线本质是什么,今天去奇都ktv唱卡拉ok去,哆啦a梦是一个动漫中的主角,单位和全角: 2009年8月6日开始大学之旅,岳阳今天的气温为38.6℃, 也就是101.48℉, 中文数字/分数: 你分三十分之二, 小陈拿三十分之五,剩下的三十分之二十三全部是我的,那是一九九八年前的事了,四川麻辣烫很好吃,五四运动留下的五四精神。笔记本五折包邮亏本大甩卖。人名识别: 我是陈鑫,也是jcesg的作者,三国时期的诸葛亮是个天才,我们一起给刘翔加油,罗志高兴奋极了因为老吴送了他一台笔记本。配对标点: 本次『畅想杯』黑客技术大赛的得主为电信09-2BF的张三,奖励C++程序设计语言一书和【畅想网络】的『PHP教程』一套。特殊字母: 【Ⅰ】(Ⅱ),英文数字: bug report chenxin619315@gmail.com or visit http://code.google.com/p/jcseg, we all admire the hacker spirit!特殊数字: ① ⑩ ⑽ ㈩.

分词结果:

歧义 和 同义词 :/w 研究/v 琢磨/v 研讨/v 钻研/v 生命 起源 ,/w 混合词 :/w 做 b超/n 检查 身体 ,/w x射线/n 本质 是 什么 ,/w 今天 去 奇都ktv/nz 唱 卡拉ok/nz 去 ,/w 哆啦a梦/nz 是 一个 动漫 中 的 主角 ,/w 单位 和 全角 :/w 2009年/m 8月/m 6日/m 开始 大学 之旅 ,/w 岳阳/ns 今天 的 气温 为 38.6℃/m ,/w 也就是 101.48℉/m ,/w 中文/n 国语/n 数字 //w 分数 :/w 你/r 分 三十分之二/m 2/30/m ,/w 小陈/nr 拿 三十分之五/m 5/30/m ,/w 剩下 的 三十分之二十三/m 23/30/m 全部 是 我的 ,/w 那是 一九九八年/m 1998年/m 前 的 事 了 ,/w 四川/ns 麻辣烫/n 很 好吃 ,/w 五四运动 留下 的 五四/m 54/m 精神 。/w 笔记本 五折/m 5折/m 包邮 亏本 大甩卖 甩卖 。/w 人名 识别 :/w 我/r 是 陈鑫/nr ,/w 也 是 jcesg/en 的 作者 ,/w 三国 时期 的 诸葛亮 是个 天才 ,/w 我们 一起 给 刘翔 加油 ,/w 罗志高/nr 兴奋 极了 因为 老吴/nr 送了 他/r 一台 笔记本 。/w 配对 标点 :/w 本次 『/w 畅想杯/nz 』/w 黑客 技术 大赛 的 得主 为 电信/nt 09/en -/w 2bf/en bf/en 的 张三 ,/w 奖励 c++/en 程序设计 语言 一书 和 【/w 畅想网络/nz 】/w 的 『/w PHP教程/nz 』/w 一套 。/w 特殊 字母 :/w 【/w Ⅰ/nz 】/w (/w Ⅱ/m )/w ,/w 英文/n 英语/n 数字 :/w bug/en report/en chenxin619315@gmail.com/en chenxin/en 619315/en gmail/en com/en or/en visit/en http/en :/w //w //w code.google.com/en code/en google/en com/en //w p/en //w jcseg/en ,/w we/en all/en admire/en appreciate/en like/en love/en enjoy/en the/en hacker/en spirit/en mind/en !/w 特殊 数字 :/w ①/m ⑩/m ⑽/m ㈩/m ./w

三. Jcseg其他主页:

Jcseg官方主页: https://code.google.com/p/jcseg/
Jcseg开源中国: http://www.oschina.net/p/jcseg
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ========================================================================== The following license applies to the JQuery JavaScript library -------------------------------------------------------------------------- Copyright (c) 2010 John Resig, http://jquery.com/ 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.

简介

Jcseg[dʒɛ'​ke'sɛ]是使用java开发的一款轻量级的中文分词器,基于流行的mmseg算法实现,并且提供了最新版本的lucene,solr,elasticsearch分词接口。 展开 收起
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/mlc0202/jcseg.git
git@gitee.com:mlc0202/jcseg.git
mlc0202
jcseg
jcseg
master

搜索帮助