LemmatizedIndex extends Index { public static String lemmatize(String s) {return lemmatizer.stem(s);} LemmatizedIndex(Index index); static String lemmatize(String s); @Override IndexResultSet getResourcesWithScores(String queryString, int limit);  }
@Test public void testLemmatize() { String[][] pluralToSingular = {{"houses","house"},{"indices","index"},{"cities","city"},{"bacteria","bacterium"},{"geese","goose"}}; for(String[] pluralSingular : pluralToSingular) { assertEquals(pluralSingular[1],LemmatizedIndex.lemmatize(pluralSingular[0])); } }