4.3 分词测试图
4.3.2 分词统计与分析系统模块流程
 
图4.4 分词系统流程图
4.3.3 分词统计与分析系统变量定义
表4.2 分词系统部分变量定义
序号    名称    类型    说明
1    word    string    关系动词
2    att    string    词性
3    count    string    关系动词数量
4    length    Int    关系动词出现频率
5    i    int    频率次数变量
6    j    int    频率次数变量
7    temp    Worditem型    关系词及出现频率
4.3.4 分词统计与分析系统核心代码
public class MySegment
{
    public List<worditem> Wordlist= new List<worditem>();
    public  void Segment(string sentence)
    {
        string DictPath = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + @"\data\";
         WordSegment ws = new WordSegment();
         ws.InitWordSegment(DictPath);
         try
         {
             ws.sentence = sentence;
             ws.StartSegment();
             List<WordResult[]> wordList = ws.WordList;
             for (int j = 1; j < wordList[0].Length - 1; j++)
             {
                string postString = Utility.GetPOSString(wordList[0][j].nPOS);
                postString = postString.Substring(0, postString.Length - 1);
                worditem wd = new worditem();
                wd.word = wordList[0][j].sWord.ToString();
                wd.att = postString;
                Wordlist.Add(wd);
              }
         }
    }
}
int length = wordlist.Count;
for (int i = 0; i <= length - 2; i++)
{
    for (int j = i+1; j <= length - 1; j++)
    {
       if (wordlist[i].count < wordlist[j].count)
       {   worditem temp = wordlist[j];
           wordlist[j] = wordlist[i];
           wordlist[i] = temp;
        }
     }
}  
4.4 保存指定日期的文本模块
4.4.1 概述
   将抓取模块中的时间变量 NewsTime  列在选择框中,选择一指定的日期。利用office的接口,将选中的新闻摘要保存到本地word文档中。
上一篇:ASP.net+sqlserver旅游信息网站设计+ER图
下一篇:ASP.net小型网上书店的设计与实现

IEEE802.15.4网络自适应策略研究

MATLAB基于流形学习与神经网络的预测建模

社交网络个性化推荐方法对比研究

jsp+mysql网络招标评审系统设计+源代码

基于生物启发神经网络的AUV三维路径规划

SOM神经网络多机器人任务分配算法研究

jsp游戏购买系统设计

STC89C52单片机NRF24L01的无线病房呼叫系统设计

上海居民的社会参与研究

浅谈高校行政管理人员的...

从政策角度谈黑龙江對俄...

基于Joomla平台的计算机学院网站设计与开发

压疮高危人群的标准化中...

浅论职工思想政治工作茬...

AES算法GPU协处理下分组加...

酵母菌发酵生产天然香料...

提高教育质量,构建大學生...