|
| |
精品推荐 |
 |
|
| |
|
|
|
|
编写简单的中文分词程序
|
日期:2006年2月17日 作者: 查看:[大字体
中字体 小字体]
|
12 } 13 14 /**//// <summary> 15 /// 从指定的文件中初始化中文词语字典和字符串次数字典。 16 /// </summary> 17 /// <param name="fileName">文件名</param> 18 private static void InitFromFile(string fileName) 19 { 20 string path = Directory.GetCurrentDirectory() +@"\" + fileName; 21 if (File.Exists(path)) 22 { 23 using (StreamReader sr = File.OpenText(path)) 24 { 25 string s = ""; 26 while ((s = sr.ReadLine()) != null) 27 { 28 ChineseWordUnit _tempUnit = InitUnit(s); 29 _countTable.InsertWord(_tempUnit.Word); 30 } 31 } 32 } 33 } 34 35 /**//// <summary> 36 /// 将一个字符串解析为ChineseWordUnit。 37 /// </summary> 38 /// <param name="s">字符串</param>
上一篇:自动处理过长字符串显示的Web控件
下一篇:Photoshop彩妆技巧:打造性感双唇
|
| 编写简单的中文分词程序 相关文章: |
|
|
|
| 编写简单的中文分词程序 相关软件: |
|
|
|
|