资源简介
中文分词一直都是中文自然语言处理领域的基础研究。目前,网络上流行的很多中文分词软件都可以在付出较少的代价的同时,具备较高的正确率。而且不少中文分词软件支持Lucene扩展。但不管实现如何,目前而言的分词系统绝大多数都是基于中文词典的匹配算法。其中最为常见的是最大匹配算法 (Maximum Matching,以下简称MM算法) 。MM算法有三种:一种正向最大匹配,一种逆向最大匹配和双向匹配。本程序实现了正向最大匹配算法。
代码片段和文件信息
// Dict handling
#include “StdAfx.h“
#include “Dict.h“
#include
#include
CDict::CDict()
{
clock_t c1 c2;
c1 = clock();
OpenDict();
c2 = clock();
unsigned long interval = c2 - c1;
cout << “Dict size : “ << mapDict.size() << endl;
cout << “Load time : “ << interval << endl;
}
CDict::~CDict()
{
mapDict.clear();
}
void CDict::OpenDict()
{
FILE *fpDict;
if ((fpDict = fopen(DICTFILENAME.c_str() “r“)) == NULL) {
cout << “Can not open the Dictionary file!“;
exit(1);
}
int id freq;
char word[16];
while (fscanf(fpDict “%d %s %d“ &id word &freq) != EOF)
{
#ifdef USE_HASHMAP
mapDict[word] = 0;
#else
mapDict.insert(map::value_type (word 0));
#endif
}
fclose(fpDict);
}
bool CDict::IsWord(string& str) const
{
bool bRet = false;
if (mapDict.find(str) != mapDict.end())
{
bRet = true;
}
cout << “ Search : “ << str << “ res : “ << bRet << endl;
return bRet;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-02-26 09:28 LBChSeg\
目录 0 2013-02-26 09:29 LBChSeg\Debug\
目录 0 2013-01-22 16:32 LBChSeg\LBChSeg\
目录 0 2013-02-26 09:28 LBChSeg\LBChSeg\Debug\
文件 94 2013-02-26 09:28 LBChSeg\LBChSeg\Debug\LBChSeg.log
文件 998 2013-01-23 09:05 LBChSeg\LBChSeg\Dict.cpp
文件 630 2013-01-22 17:40 LBChSeg\LBChSeg\Dict.h
文件 451 2013-02-01 08:44 LBChSeg\LBChSeg\LBChSeg.cpp
文件 4520 2013-01-22 16:30 LBChSeg\LBChSeg\LBChSeg.vcxproj
文件 1665 2013-01-22 16:30 LBChSeg\LBChSeg\LBChSeg.vcxproj.filters
文件 143 2013-01-22 16:26 LBChSeg\LBChSeg\LBChSeg.vcxproj.user
文件 1553 2013-01-22 16:26 LBChSeg\LBChSeg\ReadMe.txt
文件 3241 2013-01-31 20:52 LBChSeg\LBChSeg\Segment.cpp
文件 235 2013-01-22 16:50 LBChSeg\LBChSeg\Segment.h
文件 212 2013-01-22 16:26 LBChSeg\LBChSeg\stdafx.cpp
文件 233 2013-01-22 16:26 LBChSeg\LBChSeg\stdafx.h
文件 236 2013-01-22 16:26 LBChSeg\LBChSeg\targetver.h
文件 1670880 2004-07-09 23:42 LBChSeg\LBChSeg\words.dict
文件 9392128 2013-02-26 09:28 LBChSeg\LBChSeg.sdf
文件 888 2013-01-22 16:26 LBChSeg\LBChSeg.sln
文件 13824 2013-02-26 09:28 LBChSeg\LBChSeg.suo
目录 0 2013-02-26 09:23 LBChSeg\ipch\
目录 0 2013-02-26 09:23 LBChSeg\ipch\lbchseg-92dfd245\
文件 2359296 2013-02-26 09:23 LBChSeg\ipch\lbchseg-92dfd245\lbchseg-a7e47c64.ipch
相关资源
- 测试中文分词.rar
- 最新中文分词工具的词库
- 微软亚洲研究院中文分词语料库
- 中文分词用的词典文件
- 中文分词+关键字提取
- SCWS 中文分词
- HMM隐马尔可夫模型用于中文分词
- 基于svm的中文文本分类系统
- CRF,LSTM,最大后向匹配法实现中文分
- lucene中文分词器Jceseg和IK Analyzer使用
- 中科院中文分词系统ICTCLAS2015
- lucene 中文分词
- 中文自然语言处理中文分词训练语料
- 多种中文分词停用词表
- 百度中文分词词库
- 中文网页自动分类器
- 招聘就业中双向选择问题
- R语言jiebaR中文分词并做LDA主题建模
- 最大逆向中文分词算法
- elasticsearch-ik中文分词器7.6.2.zip
- Spark大数据中文分词统计Scala语言工程
- Jieba0.35中文分词组件
- rost cm6 中文分词软件
- sogou-dic-utf8搜狗词库
- 中文分词 毕业论文
- .NET中文分词
评论
共有 条评论