Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

All snippets
Create a snippet
Full search

Quick search:


Editing Snippet ID: #1004402
Snippet name:
Category, Type:
Content:
static SS singular_specials = litmap( "children", "child", "images", "image", "chess", "chess"); static Set<S> singular_specials2 = litciset("time", "machine", "line", "rule"); static S singular(S s) { if (s == null) null; try answer singular_specials.get(s); //try answer hippoSingulars().get(lower(s)); if (singular_specials2.contains(dropSuffix("s", afterLastSpace(s)))) ret dropSuffix("s", s); if (s.endsWith("ness")) ret s; if (s.endsWith("ges")) ret dropSuffix("s", s); if (endsWith(s, "bases")) ret dropLast(s); s = dropSuffix("es", s); s = dropSuffix("s", s); ret s; }
Comment:
Public (visible to everyone):
Created: 2016-08-15 21:42:07

This page without fancy editor.