static SS singular_specials = litmap( "children", "child", "images", "image", "chess", "chess"); static Set singular_specials2 = litset("time", "machine"); static S singular(S s) { if (s == null) null; try answer singular_specials.get(s); if (singular_specials2.contains(dropSuffix("s", s))) ret dropSuffix("s", s); if (s.endsWith("ness")) ret s; if (s.endsWith("ges")) ret dropSuffix("s", s); s = dropSuffix("es", s); s = dropSuffix("s", s); ret s; }