/** 回收 */ private void recycling() { List<Entry<String, Double>> list = CollectionUtil.sortMapByValue(mc.get(), -1); Set<String> targetSet = x2mat.keySet(); String word; for (int i = 0; i < recyclingCount; i++) { word = list.get(i).getKey(); allFreq -= mc.get().remove(word); // 从全局中移除数字 for (String target : targetSet) { Double r2 = x2mat.get(target).get().remove(word); if (r2 != null) { x2mc.add(target, -r2); } } } }