• 大小: 3.05M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2020-12-26
  • 语言: C#
  • 标签: C#  中文  分词  

资源简介

由吕震宇根据Free版ICTCLAS,在CLR平台下CSharp语言的实现

资源截图

代码片段和文件信息

using System;
using System.IO;
using SharpICTCLAS;

class Program
{
   static void Main(string[] args)
   {
      string DictPath = Path.Combine(Environment.CurrentDirectory “Data“) + Path.DirectorySeparatorChar;
      Console.WriteLine(“正在读入字典,请稍候...“);

      WordDictionary dict = new WordDictionary();
      dict.Load(DictPath + “coreDict.dct“);
      ShowWordsInfo(dict ‘设‘);

      Console.WriteLine(“\r\n向字典库插入“设计模式”一词...“);
      dict.AddItem(“设计模式“ Utility.GetPOSValue(“n“) 10);

      Console.WriteLine(“\r\n修改完成,将字典写入磁盘文件coreDictNew.dct,请稍候...“);
      dict.Save(DictPath + “coreDictNew.dct“);

      Console.WriteLine(“\r\n打开已写入的字典,请稍候...“);
      dict.Load(DictPath + “coreDictNew.dct“);
      ShowWordsInfo(dict ‘设‘);

      Console.Write(“按下回车键退出......“);
      Console.ReadLine()

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-12-19 06:11  SharpICTCLAS-master\
     文件         193  2013-12-19 06:11  SharpICTCLAS-master\.gitignore
     文件        1644  2013-12-19 06:11  SharpICTCLAS-master\README.md
     目录           0  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\
     目录           0  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\Samples\
     目录           0  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\Samples\AddWords2Dict\
     文件        2403  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\Samples\AddWords2Dict\AddWords2Dict.csproj
     文件        1647  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\Samples\AddWords2Dict\Program.cs
     目录           0  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\Samples\AddWords2Dict\Properties\
     文件        1148  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\Samples\AddWords2Dict\Properties\AssemblyInfo.cs
     目录           0  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\Samples\ConsoleTest\
     文件        2399  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\Samples\ConsoleTest\ConsoleTest.csproj
     文件         285  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\Samples\ConsoleTest\ConsoleTest.csproj.user
     文件       11354  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\Samples\ConsoleTest\Program.cs
     目录           0  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\Samples\ConsoleTest\Properties\
     文件        1144  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\Samples\ConsoleTest\Properties\AssemblyInfo.cs
     目录           0  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\Samples\PreProcessUtility\
     文件       17642  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\Samples\PreProcessUtility\PreProcessUtility.cs
     文件        2204  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\Samples\PreProcessUtility\PreProcessUtility.csproj
     目录           0  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\Samples\PreProcessUtility\Properties\
     文件        1302  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\Samples\PreProcessUtility\Properties\AssemblyInfo.cs
     目录           0  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\Samples\SegmentSample\
     文件         973  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\Samples\SegmentSample\Program.cs
     文件        1012  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\Samples\SegmentSample\Program.cs.bak
     目录           0  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\Samples\SegmentSample\Properties\
     文件        1134  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\Samples\SegmentSample\Properties\AssemblyInfo.cs
     文件        2441  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\Samples\SegmentSample\SegmentSample.csproj
     文件        3392  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\Samples\SegmentSample\TestWordSegment.cs
     文件        3486  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\SharpICTCLAS.sln
     文件       96256  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\SharpICTCLAS.suo
     文件       95744  2013-12-19 06:11  SharpICTCLAS-master\SharpICTCLAS\SharpICTCLAS.v12.suo
............此处省略98个文件信息

评论

共有 条评论