摘要: 在配置好heritrix后,可以输入形如:http://localhost:8080的服务器IE地址,进入UI界面登陆。则可开始建立网页爬行抓取任务。1.首先启动Heritrix后台监听程序,然后登录WebUI.成功登录WebUI后,初始界面如图所示:2. 选择上面一排导航菜单中的“Jobs”链接,开始建立一个抓取任务,如图所示:3.创建一个Job(Create New Job)有四种选择方式:Based On Existing Job、Based On a recovery、Based On a profile、With Default。我们选择第三种方式,点击“Based On a pro 阅读全文
posted @ 2012-12-22 22:12 烤德 阅读(3420) 评论(0) 推荐(0) 编辑
摘要: import jeasy.analysis.MMAnalyzer;public class JEtest { public static void main(String[] args) { String test="姚明和麦克格雷迪是火箭队的核心,不过在" + "今年的NBA常规赛中,麦克格雷迪的表现并不是很好"; MMAnalyzer analyzer=new MMAnalyzer(); MMAnalyzer.addWord("麦克格雷迪"); //提供添加词组的接口 try{ System.out.print(analyzer. 阅读全文
posted @ 2012-12-22 22:10 烤德 阅读(419) 评论(0) 推荐(0) 编辑
摘要: 1 import java.io.IOException; 2 import java.util.BitSet; 3 4 import org.apache.lucene.analysis.standard.StandardAnalyzer; 5 import org.apache.lucene.document.Document; 6 import org.apache.lucene.document.Field; 7 import org.apache.lucene.index.IndexReader; 8 import org.apache.lucene.index.... 阅读全文
posted @ 2012-12-22 22:06 烤德 阅读(969) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 * 正则表达式查询 3 */ 4 5 6 import java.io.IOException; 7 8 import org.apache.lucene.analysis.standard.StandardAnalyzer; 9 import org.apache.lucene.document.Document;10 import org.apache.lucene.document.Field;11 import org.apache.lucene.index.IndexWriter;12 import org.apache.lucene.index.Term;... 阅读全文
posted @ 2012-12-22 22:04 烤德 阅读(2416) 评论(0) 推荐(0) 编辑
摘要: /** * 测试索引 * @author Administrator * */import java.io.*;import org.apache.lucene.analysis.standard.StandardAnalyzer;import org.apache.lucene.index.IndexReader;import org.apache.lucene.index.IndexWriter;import org.apache.lucene.document.Document;import org.apache.lucene.document.Field;import org.apac 阅读全文
posted @ 2012-12-22 22:01 烤德 阅读(809) 评论(1) 推荐(0) 编辑
摘要: 具体的原因分析见“Heritrix的Modules界面不能改变选择项的问题”原因:找相关的Options文件是在Modules相对路径下的,而Modules目录是在 conf目录下。Classpath没有找到需要的文件目录。解决方法:在Eclipse里面设置conf为Classpath( 在Eclipse的Run Dialog中,Classpath标签Table,选中User Entries,然后右边会有Advance选项,选Add External Folder,把你的Conf加进去就行了)。再试,在Modules页面中的功能正常了。这里只贴图解决办法,原谅我的理解能力,我看那篇日志好久才明 阅读全文
posted @ 2012-12-22 21:52 烤德 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 其他外类对jTextArea进行实时更新显示时,首先要将jTextArea设置为public static,比如有主窗口Frame,其带有一个jTextArea,要把Data所获取的数据实时更新到Frame的jTextArea中。则:假定主窗口Frame类为:classFrame extends jFrame implements ……{ //设置jTextAreapublic staticjTextAreajtextarea;……publicFrame (){//构造函数jtextarea=new jtTextarea();……ShowData();//假设创建主窗体时,就要获取,并显示数. 阅读全文
posted @ 2012-12-22 19:56 烤德 阅读(1333) 评论(0) 推荐(0) 编辑
摘要: NetBeans乱码问题开发环境:首先指明的是IDE为NetBeans 7.0中;情况背景:在eclipse中的程序复制到NetBeans 中,代码区中的中文变乱码;其次,即使在程序中修改后的中文正确显示,但将文本输出至纯文本文件时,依然出现乱码,同样的程序,在eclipse中输出正常。问题原因:eclipse默认代码编辑编码为GBK,而NetBeans默认为UTF-8。其他建议:有人指出,若是在Windows系统中,则修改NetBeans 安装目录下/etc/netbeans.conf下的,在变量netbeans_default_options中添加(或者修改)“-J-Dfile.encod 阅读全文
posted @ 2012-12-22 19:51 烤德 阅读(285) 评论(0) 推荐(0) 编辑
摘要: java中选择使用Collection类的技巧JDK API中定义了多种Collection类,但实际上使用的困难在于如何根据特定的需求选择适宜的类,在此,描述在选择Collection类时的一些技巧:1.如果不是局限于JDK1.1.X版本,则应该使用Collection结构中的通用实现类,而不是使用像Vector、Stack、Hashtable等基本类。2.对于有序的Collection结构(有序,指已经拥有排列顺序的,而你不希望这个顺序被打乱的结构)应该使用ArrayList类,而不是Vector。3.对于无序的Collection结构(即,数据顺序随便安排的结构)建议使用HashSet, 阅读全文
posted @ 2012-12-22 19:50 烤德 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 首先,看一下以下代码:int i = 1; //全局作用域变量ivoid Print();int main(int argc, char* argv[]){ cout<<"i="<< i<<endl; //语句1 int i = 10; //局部作用域变量i int j = i; //局部作用域变量j cout<<"i="<< i<<endl; //语句2 cout<<"j="<< j<<endl; //语句5 for(int 阅读全文
posted @ 2012-12-04 21:46 烤德 阅读(359) 评论(0) 推荐(0) 编辑