sS cereproc_preprocess(S text) { text = trim(text); if (empty(text)) null; text = text.replaceAll("\\s+", " "); S text2 = shorten(text, 1000); if (neq(text, text2)) print("Cereproc: Text shortened from " + l(text) + " to " + l(text2) + " chars"); ret text2; }