zoukankan      html  css  js  c++  java
  • 使用PanGu分词很简单

    private static bool _Inited = true;
            static void Main(string[] args)
            {
                if (_Inited)
                {
                    PanGu.Segment.Init(@"D:\Lucene.Net\df\soo\pg\bin\Debug\PanGu.xml");
                    _Inited = false;
                }
                Segment segment = new Segment();
                ICollection<WordInfo> words = segment.DoSegment("如何防止console程序文本区被选取或者键盘的控制。。我写的程序当鼠标点选文本区的时候会中断运行。。请问如何解决。");
                foreach (WordInfo i in words)
                {
                    Console.WriteLine(i.Rank);
                    Console.WriteLine(i.Frequency);
                    Console.WriteLine(i.OriginalWordType);
                    Console.WriteLine(i.Pos);
                    Console.WriteLine(i.Position);
                    Console.WriteLine(i.Rank);
                    Console.WriteLine(i.Word);
                    Console.WriteLine(i.WordType);
                    Console.WriteLine("========");
                }
                Console.Read();
            }

    注意D:\Lucene.Net\df\soo\pg\bin\Debug\PanGu.xml

    和 PanGu.xml中的 <DictionaryPath>..\Dictionaries</DictionaryPath>

    目录的位置。

    否则会出错

  • 相关阅读:
    Sharepoint 2007 Forms认证与File Not Found错误
    完全控制SharePoint站点菜单(Get full control of SharePoint ActionMenus) Part 1
    从WSS 3.0到MOSS 2007
    如何备份sharepoint中的文档库?
    图片与文本的对齐方式
    backgroundimage 背景图片的设置
    css中三种隐藏方式
    font(字体)所使用的属性
    display属性
    margin中的bug解决方法
  • 原文地址:https://www.cnblogs.com/coolwind/p/1629932.html
Copyright © 2011-2022 走看看