解决方案 »
- telnet连接接收返回信息时乱码
- 在本地机子上可以运行java3D的APPLET,但是放到服务器上后,在客户端浏览器就不能运行,WHY?(解决高分赠送)
- 怎么写一个数的n次开方?
- 大家好,我是JAVA的初学者,以前用ASP,对XML没多少概念,能否推荐点学习XML的资料。
- 初学java,while循环次数求解
- 重写DefaultTreeCellRenderer后getTreeCellRendererComponent的执行问题
- 请教几个问题
- string(再线等)
- linux下的jni问题?
- 请教各位:JAVA操作ORACLE的问题 急!!!
- 帮看一条日期的正则
- 我的MyEclipse启动服务就报错!!!
注释行//加入新词项的下一句: TermInfo aTermInfo = new TermInfo();
这句出问题了,TermInfo类的定义在一楼最下面贴了。eclipse该行的调试信息——“ClassNotFoundException”。 public TreeMap<String, TermInfo> setTermInfoSet() {
long sTime = System.currentTimeMillis();
TreeMap<String, TermInfo> terms = new TreeMap<String, TermInfo>();//新建TreeMap对象
String currentArticleKey = articleSortedMap.firstKey();//取文档集最小的键值
while(currentArticleKey != null) {
String currentArticleContent = articleSortedMap.get(currentArticleKey);//文档正文内容
String str = currentArticleContent.substring(2,3);//文档第一个非空词项
String tempTerm = str;
for(int i = 3; i != currentArticleContent.length() - 1;) {//遍历文档字符串
str = currentArticleContent.substring(i, i+1);
if(str.equals(" ")) i++;
int j = i;
while(!str.equals(" ")) {//取词项,词项间以" "隔开
tempTerm += str;
j++;
str = currentArticleContent.substring(j, j+1);
}
i = j;
if(stopwordSet.contains(tempTerm))
continue;//遇到停用词,换下一个非空词项
else {
if(!terms.keySet().contains(tempTerm)) {//加入新词项
TermInfo aTermInfo = new TermInfo();
aTermInfo.totalCount = 1;
aTermInfo.inDocInfo.put(currentArticleKey, 1);
terms.put(tempTerm, aTermInfo);
}
else {//更新词项信息
terms.get(tempTerm).totalCount++;
Integer tempCount = terms.get(tempTerm).inDocInfo.get(currentArticleKey) + 1;
terms.get(tempTerm).inDocInfo.put(currentArticleKey, tempCount);
}
}
}
currentArticleKey = articleSortedMap.higherKey(currentArticleKey);//取下一个严格高于当前键值的最小键值
}
long eTime = System.currentTimeMillis();
System.out.println("stopword count is "+terms.size());
System.out.println("Building the TermInfoSortedMap used "+(eTime - sTime)+"ms");
return terms;
}
用的eclipse还是cmd运行的...?