这两天一直在捣腾lucene

it2022-05-09  41

    开始看了下java的,弄不太明白,没学过java,后来找了了.net的,主要是研究下dotlucene,由于刚刚接触c#,对这样一个开源的项目研究还是有点困难,不过我比较喜欢搜索类的,所以还是看了起来,看了大量的资料,英文的和中文的,现在终于是调试成功了,而且加了一个基于词表的中文分词。   现在还有Highlighter高亮显示的没弄出来,正在研究中!     还有就是自己写的html2text,感觉效率不是很好,老是程序一运行程序就卡死!不知道什么原因

 1 public   string  html2text( string  content, string  s, string  e)  2          { 3            int s_pos=content.IndexOf (s);//查找开始字符串位置 4            while(s_pos!=-1) 5            { 6                int e_pos=content.IndexOf (e,s_pos);//结束字符串位置 7                if(e_pos!=-1)//如果存在结束字符串则进去替换处理 8                { 9                    string replacestr=content.Substring (s_pos,e_pos+e.Length-s_pos);//夹在开始和结束字符串之间的被替换字符10                    content=content.Replace(replacestr,"");11                    s_pos=content.IndexOf (s);12                }13            }14            content=content.Replace("\n","");15            content=content.Replace("\r",""); 16            content=content.Replace(" ","");17            content=content.Replace("    ","");//tab键过滤18            //content=content.Replace(" ","");//空格过滤19            return content;20        }

 以前用VB写的感觉没这么卡的,可能也跟一边索引有关吧!

转载于:https://www.cnblogs.com/sunli/archive/2005/11/13/275401.html

相关资源:数据结构—成绩单生成器

最新回复(0)