Again, please download a friend to use VS2005 to open and
Install. NET Framework 2.0. The source code is C ++/CLI, not C #,
Please do not send emails to ask me questions. Thank you for your cooperation.
Download source code at the end of the article
NICTCLAS is a free version of ICTCLAS, a famous Chinese Emy of Sciences Institute of computing technology.. NET package version, which is encapsulated into NICTCLAS using C ++/CLI based on the original free EXE source code. dll, rewrite the original CResult class to NICTCLAS managed class, and make a few changes to the source code to adapt to the VC8 compilation. Of course, there are N warnings, such as strcpy, because there are too many warnings to be ignored. If any error occurs, please correct it.
NICTCLAS is simplified to a certain extent. The interface is very simple and the common word splitting application is sufficient. Here we provide a C # execution program call example. Download and decompress the dictionary file in the Data directory corresponding to NICTCLAS. dll. If you need to call it in ASP. NET, modify the dictionary file path in the code.
Call code example
Public partial class Form1: Form
{
NICTCLAS nictclas;
Public Form1 ()
{
InitializeComponent ();
Try
{
Nictclas = new NICTCLAS ();
}
Catch (Exception ex)
{
MessageBox. Show (ex. Message );
}
}
Private void button#click (object sender, EventArgs e)
{
If (radioButton1.Checked)
Nictclas. OperateType = eOperateType. OnlySegment;
Else if (radioButton2.Checked)
Nictclas. OperateType = eOperateType. FirstTag;
Else if (radioButton3.Checked)
Nictclas. OperateType = eOperateType. SecondTag;
If (radioButton4.Checked)
Nictclas. OutputFormat = eOutputFormat. PKU;
Else if (radioButton5.Checked)
Nictclas. OutputFormat = eOutputFormat. _ 973;
Else if (radioButton6.Checked)
Nictclas. OutputFormat = eOutputFormat. XML;
DateTime start = DateTime. Now;
String result = "";
// **************** Word segmentation processing call
Nictclas. ParagraphProcessing (textBox1.Text, ref result );
DateTime finish = DateTime. Now;
TimeSpan t = (TimeSpan) (finish-start );
TextBox3.Text = t. TotalMilliseconds. ToString () + "ms ";
TextBox2.Text = result;
}
}
C # Call the program
Download execution File
(Sorry, before downloading it, add some credits for the next book.
Beneficiary's link http://www.netyi.net/in.asp? Id = edison1024, displayed after clicking)
Http://files.cnblogs.com/edison1024/NICTCLAS_Release.rar
Program Files (including C ++/cli c # source code and engineering files)
Http://files.cnblogs.com/edison1024/ictclas.rar
Dictionary files
Http://files.cnblogs.com/edison1024/Data.rar
ICTCLAS official free version
Http://www.ict.ac.cn/freeware/003_ictclas.asp