|
| |
精品推荐 |
 |
|
| |
|
|
|
|
编写简单的中文分词程序
|
日期:2006年2月17日 作者: 查看:[大字体
中字体 小字体]
|
39 /// <returns>解析得到的ChineseWordUnit</returns> 40 private static ChineseWordUnit InitUnit(string s) 41 { 42 Regex reg = new Regex(@"\s+"); 43 string[] temp = reg.Split(s); 44 if (temp.Length!=2) 45 { 46 throw new Exception("字符串解析错误:"+s); 47 } 48 return new ChineseWordUnit(temp[0],Int32.Parse(temp[1])); 49 } 50 51 /**//// <summary> 52 /// 分析输入的字符串,将其切割成一个个的词语。 53 /// </summary> 54 /// <param name="s">待切割的字符串</param> 55 /// <returns>所切割得到的中文词语数组</returns> 56 public static string[] ParseChinese(string s) 57 { 58 int _length = s.Length; 59 string _temp = String.Empty; 60 ArrayList _words = new ArrayList(); 61 62 for(int i=0;i<s.Length;) 63 { 64 _temp = s.Substring(i,1); 65 if (_countTable.GetCount(_temp)>1) 66 { 67 int j=2;
上一篇:自动处理过长字符串显示的Web控件
下一篇:Photoshop彩妆技巧:打造性感双唇
|
| 编写简单的中文分词程序 相关文章: |
|
|
|
| 编写简单的中文分词程序 相关软件: |
|
|
|
|