/** * The binary features in in any unitInstance between start...end or otherInstance. Equivalently, * the features in the sum of {unitInstance[start],...,unitInstance[end-1],otherInstance} */ private Set<Feature> binaryFeatureSet(int start, int end, Instance otherInstance) { Set<Feature> s = new HashSet<Feature>(); for (int i = start; i < end; i++) { addAll(s, unitInstance[i].binaryFeatureIterator()); } if (otherInstance != null) addAll(s, otherInstance.binaryFeatureIterator()); return s; }