// for stuff like #1000349 static class LFixedPositions extends LearnerImpl { static boolean debug; Map map = new TreeMap(); public void processInOut(Object _in, Object _out) { // Only looks at out... funny, eh? String out = cast _out; for (int i = 0; i < out.length(); i++) { String s = map.get(i); String c = out.substring(i, i+1); if (s == null) map.put(i, c); else if (s.equals("")) { } else if (!s.equals(c)) map.put(i, ""); // TILT } for (int i : map.keySet()) if (i >= out.length()) map.put(i, ""); } public Object processIn(Object _in) { String in = cast _in; new List l; for (int i = 0; i < in.length(); i++) l.add(in.substring(i, i+1)); for (int i : map.keySet()) { String s = map.get(i); if (!s.equals("")) { while (i >= l.size()) l.add(" "); l.set(i, s); } } return join("", l); } }