1、加入盘古分词方法

  /// <summary>
       /// 对输入的搜索的条件进行分词
       /// </summary>
       /// <param name="str"></param>
       /// <returns></returns>
       public static List<string> GetPanGuWord(string str)
       {
           Analyzer analyzer = new PanGuAnalyzer();
           TokenStream tokenStream = analyzer.TokenStream("", new StringReader(str));
           Lucene.Net.Analysis.Token token = null;
           List<string> list = new List<string>();
           while ((token = tokenStream.Next()) != null)
           {
              list.Add(token.TermText());
           }
           return list;
       }
View Code

相关文章:

  • 2021-09-08
  • 2021-11-11
  • 2021-06-06
  • 2021-09-08
  • 2022-01-06
猜你喜欢
  • 2021-10-10
  • 2021-08-05
  • 2021-09-15
相关资源
相似解决方案