public void startScanFeatures(Observation obsr) { currentFeatures.clear(); currentFeatureIdx = 0; // scan over all context predicates for (int i = 0; i < obsr.cps.length; i++) { Element elem = (Element) dict.dict.get(new Integer(obsr.cps[i])); if (elem == null) { continue; } if (!(elem.isScanned)) { // scan all labels for features Iterator it = elem.lbCntFidxes.keySet().iterator(); while (it.hasNext()) { Integer labelInt = (Integer) it.next(); CountFIdx cntFIdx = (CountFIdx) elem.lbCntFidxes.get(labelInt); if (cntFIdx.fidx >= 0) { Feature f = new Feature(); f.FeatureInit(labelInt.intValue(), obsr.cps[i]); f.idx = cntFIdx.fidx; elem.cpFeatures.add(f); } } elem.isScanned = true; } for (int j = 0; j < elem.cpFeatures.size(); j++) { currentFeatures.add(elem.cpFeatures.get(j)); } } }