惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

MyScale Blog
MyScale Blog
F
Fortinet All Blogs
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
Docker
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
爱范儿
爱范儿
V
Visual Studio Blog
Last Week in AI
Last Week in AI
WordPress大学
WordPress大学
aimingoo的专栏
aimingoo的专栏
小众软件
小众软件
L
LangChain Blog
Vercel News
Vercel News
阮一峰的网络日志
阮一峰的网络日志
IT之家
IT之家
P
Proofpoint News Feed
博客园_首页
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
The GitHub Blog
The GitHub Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Check Point Blog
Engineering at Meta
Engineering at Meta
Microsoft Azure Blog
Microsoft Azure Blog

博客园 - amber lee zhao

(武义检察院)sqlplus执行sql脚本 windows下squid安装与配置 缓存服务器 System.Data.OracleClient requires Oracle client software version 8.1.7 or greater. Oracle Listener crash in Windows 【转】Session丢失原因分析 【转】Session丢失问题二 【转】Session丢失问题解决方法一 OracleMembershipProvider、OracleRoleProvider源代码 使用EnterpriseLibrary插入Oracle CLOB数据 使用System.Net.Mail发送邮件 - amber lee zhao 【转】oracle SQL性能优化 DataGridView导出为Excel文件 - amber lee zhao 使用HtmlAgilityPack批量抓取网页数据 OracleMembershipProvider与登录控件使用的技巧 - amber lee zhao 在ASP.NET中使用Quartz.net进行工作调度 结合OracleMembershipProvider开发简单的asp.net应用程序----配置web.config文件 C#版本的OracleMembershipProvider Double-Array Trie分词词典简述 [转] .net下ICTCLAS原子分词和lucene的Token比较
sharpICTCLAS 中在找出所有词组组合时的优化
amber lee zhao · 2007-08-16 · via 博客园 - amber lee zhao

在Segment.GenerateWordNet()中,循环每一个原子分词,找出所有可能的词组组合。
像下面的一句话的进行分词:

         string sSentence = @"三星SHX-132型号的(手机)1元钱256.89元12.14%百分比12%";

原子分词:


      始##始     
1
         三     
7
         星     
7
   SHX
-132     5
         型     
7
         号     
7
         的     
7
         (     
6
         手     
7
         机     
7
         )     
6
         
1     5
         元     
7
         钱     
7
    
256.89     9
         元     
7
    
12.14%     5
         百     
7
         分     
7
         比     
7
        
12     5
         %     
6
      末##末     
4

在进入词组判断时,调用GenerateWordNet()

// 将所有可能的组词存入m_segGraph
         for (int i = 0; i < atomSegment.Count; i++)//All the word
         {
            sWord 
= atomSegment[i].sWord;//Get the current atom
            int j = i + 1;

            
             
//是否过滤一下?只考虑中文字??
            
//WordInfo wordInfo = coreDict.GetMatchedWordInfo(sWord);
            while (j < atomSegment.Count && coreDict.GetMaxMatch(sWord, out sMaxMatchWord, out nPOSRet))
            
{
               
if (sMaxMatchWord == sWord)  // 就是我们要找的词
               {
                  WordInfo info 
= coreDict.GetWordInfo(sWord); // 该词可能就有多种词性

.
               }


               sWord 
+= atomSegment[j++].sWord;
            }

         }

在while循环中,需要判断下面这些词组:
“三星SHX-132”,“星SHX-132”,“SHX-132”,“SHX-132型”,“的(”,“(”,“手机)”,“机)”,“)”,“1”,“钱256.89”,“256.89”,“元12.14%”等等。
词组判断共进行了44次,无效词组判断有17次,无效效率达到38.6%
个人认为,数字、符号、分隔符、字母无需进行词组判断,可以节省一些时间效率。