// returns pair(word, distance) // or null when search step was not successful static ItIt> levenClosestIC_iteratorWithNulls(LS list, S word) { if (empty(list)) ret emptyItIt(); ret iff(new F0 { int limit = Integer.MAX_VALUE-1; int idx; O get() { if (limit == 0 || idx >= l(list)) ret endMarker(); S s = list.get(idx++); int dist = leven_limitedIC(word, s, limit); if (dist < limit) { limit = dist; ret s; } null; } }); }