#region 方法:对要搜索的词分词第一种方法
   /// <summary>
    /// 对要搜索的词分词第一种方法
   /// </summary>
   /// <param name="keywords">要分的关键词</param>
   /// <param name="ktTokenizer"></param>
   /// <returns></returns>
    static public string GetKeyWordsSplitBySpace(string keywords, PanGuTokenizer ktTokenizer)
    {
        StringBuilder result = new StringBuilder();
        ICollection<WordInfo> words = ktTokenizer.SegmentToWordInfos(keywords);
        foreach (WordInfo word in words)
        {
            if (word == null)
            {
                continue;
            }

            result.AppendFormat("{0}^{1}.0 ", word.Word, (int)Math.Pow(3, word.Rank));
        }
        return result.ToString().Trim();
    }
    #endregion

调用 string strkey = GetKeyWordsSplitBySpace(txtkey, new PanGuTokenizer());

相关文章:

  • 2022-12-23
  • 2022-01-13
  • 2021-11-18
  • 2021-06-16
  • 2021-12-07
  • 2021-06-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-09
  • 2021-08-16
  • 2021-08-04
  • 2021-12-02
  • 2022-12-23
  • 2021-06-21
  • 2021-08-08
相关资源
相似解决方案