static LL ai_spreadCertainIndices(L tokPat, L tokS, L indices) { int extra = l(tokS)-l(tokPat); if (extra < 0 || empty(indices)) ret emptyList(); new LL results; for (L spread : allSpreads(extra, l(indices))) { new L tok; int pos = 0, iSpread = 0, iIndices = 0; for i over tokPat: if (!eq(get(indices, iIndices), i)) tok.add(tokS.get(pos++)); else { ++iIndices; int take = spread.get(iSpread++); tok.add(join(subList(tokS, pos, pos+take+1))); pos += take+1; } results.add(tok); } ret results; }