static L countFixer_them = splitAtSpace("nd st rd th"); static S countFixer(S s) { L tok = nlTok2(s); for (int i = 1; i+2 < l(tok); i += 2) if (isInteger(tok.get(i)) && contains(countFixer_them, tok.get(i+2))) pcall { // Is it correct? long l = parseLong(tok.get(i)); long d = l % 10, h = l % 100; tok.set(i+2, h-d == 10 ? "th" : d == 1 ? "st" : d == 2 ? "nd" : d == 3 ? "rd" : "th"); } ret join(tok); }