数据结构课程设计报告中文分词.docx

上传人:b****1 文档编号:13741080 上传时间:2023-06-16 格式:DOCX 页数:15 大小:189.14KB
下载 相关 举报
数据结构课程设计报告中文分词.docx_第1页
第1页 / 共15页
数据结构课程设计报告中文分词.docx_第2页
第2页 / 共15页
数据结构课程设计报告中文分词.docx_第3页
第3页 / 共15页
数据结构课程设计报告中文分词.docx_第4页
第4页 / 共15页
数据结构课程设计报告中文分词.docx_第5页
第5页 / 共15页
数据结构课程设计报告中文分词.docx_第6页
第6页 / 共15页
数据结构课程设计报告中文分词.docx_第7页
第7页 / 共15页
数据结构课程设计报告中文分词.docx_第8页
第8页 / 共15页
数据结构课程设计报告中文分词.docx_第9页
第9页 / 共15页
数据结构课程设计报告中文分词.docx_第10页
第10页 / 共15页
数据结构课程设计报告中文分词.docx_第11页
第11页 / 共15页
数据结构课程设计报告中文分词.docx_第12页
第12页 / 共15页
数据结构课程设计报告中文分词.docx_第13页
第13页 / 共15页
数据结构课程设计报告中文分词.docx_第14页
第14页 / 共15页
数据结构课程设计报告中文分词.docx_第15页
第15页 / 共15页
亲,该文档总共15页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

数据结构课程设计报告中文分词.docx

《数据结构课程设计报告中文分词.docx》由会员分享,可在线阅读,更多相关《数据结构课程设计报告中文分词.docx(15页珍藏版)》请在冰点文库上搜索。

数据结构课程设计报告中文分词.docx

数据结构课程设计报告中文分词

计算机科学学院

数据结构课程设计

 

题目:

中文分词

学生姓名:

朱亮

学号:

123455012014

专业:

计算机科学与技术

班级:

12级

(2)班

指导教师姓名及职称:

陈明讲师

起止时间:

2014年3月——2014年4月

1.需求分析

1.1研究背景,目的及意义

随着信息时代的到来,可供人们查阅和检索的中文信息越来越多,如何在茫茫中文信息世界中寻找到我们需要的资料成为一个越来越重要的问题。

在这个信息泛滥的时代,用人工处理信息已经不能满足需求。

所以,就要借助于自动化的方法,帮助人们归纳,检索和管理信息,以此来解决现代社会信息丰富但知识难以获取的矛盾。

现在已经有了很多自动化的工具来自动摘要,自动文件检索等各种语言处理技术。

在各种各样的语言处理技术中,核心就是分词,通过分词简化语言处理的过程,所以,研究中文分词对语言处理技术来说是非常有意义的.

中文分词,很明显就是借助计算机给中文段词,使其能正确地表达想要表达的内容。

首先,中文比起其他语言有着其特有的特点,中文的词可以是单个字,也可以是双个字,或者是像成语一样的多字词,所以中文分词是个非常复杂的问题。

目前来看,我们已经能看见很多的中文分词软件,如盘古分词,IKAnalyzer,Paoding和FreeICTCLAS此类已经分厂成熟的中文分词软件,他们具有占用内存小,分词准确,分词效率搞,用户体验良好的特点,因为有了这些中文分词系统的存在,才能为各种形式的需要用到语言处理技术的软件给予技术支持基础,为中文分词的发展做出了极大的贡献。

 

2.概要设计

要完成整个中文分词系统,第一,需要有实现分词功能的源代码,来对输入的文本信息进行识别和分词,第二,进行分词需要有大量的词组文本作为基础来为分词系统提供样本来分词,第三,作为一个实用性的语言处理软件,需要有一个容易操作的界面,如果把整个程序看做一个圆的话,那么上述三者的关系就如下图1-1的关系一样,

 

 

 

图1-1

3.详细设计

分词功能实现:

///应用程序的主入口点。

///

[STAThread]

staticvoidMain()

{

Application.Run(newForm1());

}

privatevoidForm1_Load(objectsender,System.EventArgse)

{

}

privatevoidbutton_Split_Click(objectsender,System.EventArgse)

{

//加载词语列表

seg=newSegment();

seg.InitWordDics();

label_Time.Text=seg.EventTime.ToString();

//分词

if(seg!

=null)

{

seg.Separator="/";

textBox_Test.Text=seg.SegmentText(textBox_Test.Text,true);

label_Time.Text=seg.EventTime.ToString();

}

}

privatevoidbutton1_Click(objectsender,System.EventArgse)

{

}

privatevoidbutton_Sort_Click(objectsender,System.EventArgse)

{

seg.SortDic();

label_Time.Text=seg.EventTime.ToString();

}

}

}

词组数据文档:

sDict.txt

sNoise.txt

sNumber.txt

sPrefix.txt

sWord.txt

 

图形界面实现:

publicForm1()

{

//

//Windows窗体设计器支持所必需的

//

InitializeComponent();

…………

}

 

4.调试分析报告

序号

时间

问题

解决方法

1

2014.4.1

using System.Windows.Forms;的语句,但生成解决方案时出错

在项目上点击鼠标右键->添加引用->.Net选项卡->System.Windows.Forms.dll->选择->确定

2

2014.4.3

不知道如何引用可视化窗体

usingSystem.Drawing的利用

3

2014.4.7

缺少一种分词方法

使用usingShootSeg为分词提供源代码

5.用户使用说明

我所编写的这个中文分词系统使用起来非常简单易懂,很容易上手操作.首先打开.EXE文件如图1-2

图1-2

然后再白色输出框内输入文本信息如图1-3

图1-3

点击一键分词按钮如图1-4

图1-4

程序就会完成分词任务如图1-5

图1-5

程序还会显示完成分词的时间如图1-6

图1-6

使用完程序后,还可以按界面右上方退出键退出程序以释放空间如图1-7

图1-7

以上便是这个程序的使用方法,坚持简洁的原则,本程序简单易懂,分词速度快,效率高,拥有很好的用户体验.

6.测试结果

测试文本为前文一段话:

在各种各样的语言处理技术中,核心就是分词,通过分词简化语言处理的过程,所以,研究中文分词对语言处理技术来说是非常有意义的.结果如图1-8

图1-8

分词结果准确

7.源程序附录

-----------------------------中文分词源代码--------------------------------

usingSystem;

usingSystem.Drawing;

usingSystem.Collections;

usingSystem.ComponentModel;

usingSystem.Windows.Forms;

usingSystem.Data;

usingSystem.IO;

usingShootSeg;

namespaceSegTest

{

///

///Form1的摘要说明。

///

publicclassForm1:

System.Windows.Forms.Form

{

Segmentseg;

 

///

///必需的设计器变量。

///

///

 

privateSystem.ComponentModel.Containercomponents=null;

privateSystem.Windows.Forms.Buttonbutton_Split;

privateLabellabel_Time;

privateSystem.Windows.Forms.TextBoxtextBox_Test;

publicForm1()

{

//

//Windows窗体设计器支持所必需的

//

InitializeComponent();

//

//TODO:

在InitializeComponent调用后添加任何构造函数代码

//

}

///

///清理所有正在使用的资源。

///

protectedoverridevoidDispose(booldisposing)

{

if(disposing)

{

if(components!

=null)

{

components.Dispose();

}

}

base.Dispose(disposing);

}

#regionWindows窗体设计器生成的代码

///

///设计器支持所需的方法-不要使用代码编辑器修改

///此方法的内容。

///

privatevoidInitializeComponent()

{

this.textBox_Test=newSystem.Windows.Forms.TextBox();

this.button_Split=newSystem.Windows.Forms.Button();

this.label_Time=newSystem.Windows.Forms.Label();

this.SuspendLayout();

//

//textBox_Test

//

this.textBox_Test.Anchor=((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top|System.Windows.Forms.AnchorStyles.Bottom)

|System.Windows.Forms.AnchorStyles.Left)

|System.Windows.Forms.AnchorStyles.Right)));

this.textBox_Test.Location=newSystem.Drawing.Point(16,16);

this.textBox_Test.Multiline=true;

this.textBox_Test.Name="textBox_Test";

this.textBox_Test.ScrollBars=System.Windows.Forms.ScrollBars.Vertical;

this.textBox_Test.Size=newSystem.Drawing.Size(512,208);

this.textBox_Test.TabIndex=1;

this.textBox_Test.TabStop=false;

//

//button_Split

//

this.button_Split.Anchor=((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom|System.Windows.Forms.AnchorStyles.Left)));

this.button_Split.BackColor=System.Drawing.SystemColors.MenuHighlight;

this.button_Split.Location=newSystem.Drawing.Point(220,230);

this.button_Split.Name="button_Split";

this.button_Split.Size=newSystem.Drawing.Size(118,34);

this.button_Split.TabIndex=3;

this.button_Split.Text="一键分词";

this.button_Split.UseVisualStyleBackColor=false;

this.button_Split.Click+=newSystem.EventHandler(this.button_Split_Click);

//

//label_Time

//

this.label_Time.Anchor=((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom|System.Windows.Forms.AnchorStyles.Right)));

this.label_Time.AutoSize=true;

this.label_Time.Location=newSystem.Drawing.Point(424,240);

this.label_Time.Name="label_Time";

this.label_Time.Size=newSystem.Drawing.Size(0,12);

this.label_Time.TabIndex=4;

//

//Form1

//

this.AutoScaleBaseSize=newSystem.Drawing.Size(6,14);

this.ClientSize=newSystem.Drawing.Size(544,269);

this.Controls.Add(this.label_Time);

this.Controls.Add(this.button_Split);

this.Controls.Add(this.textBox_Test);

this.MaximizeBox=false;

this.MinimizeBox=false;

this.Name="Form1";

this.ShowIcon=false;

this.StartPosition=System.Windows.Forms.FormStartPosition.CenterScreen;

this.Text="中文分词";

this.Load+=newSystem.EventHandler(this.Form1_Load);

this.ResumeLayout(false);

this.PerformLayout();

}

#endregion

///

///应用程序的主入口点。

///

[STAThread]

staticvoidMain()

{

Application.Run(newForm1());

}

 

privatevoidForm1_Load(objectsender,System.EventArgse)

{

}

privatevoidbutton_Split_Click(objectsender,System.EventArgse)

{

//加载词语列表

seg=newSegment();

seg.InitWordDics();

label_Time.Text=seg.EventTime.ToString();

//分词

if(seg!

=null)

{

seg.Separator="/";

textBox_Test.Text=seg.SegmentText(textBox_Test.Text,true);

label_Time.Text=seg.EventTime.ToString();

}

}

privatevoidbutton1_Click(objectsender,System.EventArgse)

{

}

privatevoidbutton_Sort_Click(objectsender,System.EventArgse)

{

seg.SortDic();

label_Time.Text=seg.EventTime.ToString();

}

}

}

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 自然科学

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2