Exemple #1
0
 /// <summary>
 /// 获取ICTCLAS实例
 /// </summary>
 /// <returns></returns>
 public static ICTCLAS GetInstance()
 {
     if (_instance == null)
     {
         _instance = new ICTCLAS(AppDomain.CurrentDomain.BaseDirectory);
     }
     return(_instance);
 }
        private void GetTermDic()
        {
            ICTCLAS           clas  = ICTCLAS.GetInstance();
            List <ResultTerm> terms = clas.Segment(baikeEntry.text);

            baikeEntry.wordDic.Clear();
            foreach (ResultTerm term in terms)
            {
                if (baikeEntry.wordDic.ContainsKey(term.Word))
                {
                    baikeEntry.wordDic[term.Word] += 1;
                }
                else
                {
                    baikeEntry.wordDic.Add(term.Word, 1);
                }
            }
        }
Exemple #3
0
 /// <summary>
 /// ��ȡICTCLASʵ��
 /// </summary>
 /// <returns></returns>
 public static ICTCLAS GetInstance()
 {
     if (_instance == null)
     {
         _instance = new ICTCLAS(AppDomain.CurrentDomain.BaseDirectory);
     }
     return _instance;
 }