/**
* 一次性统计概率,节约时间
*/
private void statisticProb() {
System.out.println("统计概率");
TIntFloatIterator it = wordProb.iterator();
while(it.hasNext()){
it.advance();
float v = it.value()/totalword;
it.setValue(v);
int key = it.key();
if(key<0)
continue;
Cluster cluster = new Cluster(key,v,alpahbet.lookupString(key));
clusters.put(key, cluster);
}
TIntObjectIterator<TIntFloatHashMap> it1 = pcc.iterator();
while(it1.hasNext()){
it1.advance();
TIntFloatHashMap map = it1.value();
TIntFloatIterator it2 = map.iterator();
while(it2.hasNext()){
it2.advance();
it2.setValue(it2.value()/totalword);
}
}
}