zoukankan      html  css  js  c++  java
  • 文章标题 标签提取

    引用PanGuDLL 

    private string GetWords(string input)
        {
            ICollection<PanGu.WordInfo> words = new Segment().DoSegment(input);
            StringBuilder result = new StringBuilder();

            List<string> list = new List<string>();
            foreach (WordInfo word in words)
            {
                if (word != null && word.Word.Length > 1)
                {
                    bool has = false;
                    foreach (string w in list)
                    {
                        if (string.Compare(w, word.Word, true) == 0)
                        {
                            has = true;
                            break;
                        }
                    }
                    if (has)
                        continue;

                    list.Add(word.Word);
                    result.Append(word.Word).Append(",");
                }
            }
            if (result.Length > 0)
                return result.ToString(0, result.Length - 1);
            else
                return string.Empty;
        }

  • 相关阅读:
    习题三 答案
    习题二 答案
    Python开发【第三篇】:Python基本数据类型
    习题四 答案
    第一个python程序-判断登陆用户名和密码是否正确
    BFPRT算法 查找第k小的数
    设计模式----单例模式
    设计模式----原型模式
    非本地跳转
    链接器如何使用静态库解析引用
  • 原文地址:https://www.cnblogs.com/freexiaoyu/p/2339392.html
Copyright © 2011-2022 走看看