Warning: session_start(): open(/var/lib/php/sessions/sess_afb95orslr88g2nuksc1c4noe5, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
static S getSingularFromWordHippo(S word) {
word = tolower(word);
SS hippoSingulars = pairsToMap((L) scanStructureLog(#1011041, "singulars"));
try answer hippoSingulars.get(word);
S html = loadPage("http://www.wordhippo.com/what-is/the-singular-of/" + urlencode(word) + ".html");
S pat = "The singular form of " + word + " is ";
int i = html.indexOf(pat);
if (i < 0) null;
i += l(pat);
int j = indexOf(html, "", i);
if (j < 0) null;
S singular = substring(html, i, j);
logStructure(#1011041, "singulars", pair(word, singular));
}