VerbDeinflection { public static Deinflections searchJpDeinflected(final String verb, final RomanizationEnum romanization) { final SearchQuery result = new SearchQuery(DictTypeEnum.Edict); final String conv = KanjiUtils.halfwidthToKatakana(verb); final String romaji = RomanizationEnum.NihonShiki.toRomaji(romanization.toHiragana(conv)); final Deinflections deinflections = VerbDeinflection.deinflect(romaji); result.query = deinflections.deinflectedVerbs.toArray(new String[0]); for (int i = 0; i < result.query.length; i++) { result.query[i] = RomanizationEnum.NihonShiki.toHiragana(result.query[i]); } result.isJapanese = true; result.matcher = MatcherEnum.Exact; deinflections.query = result; return deinflections; } private  VerbDeinflection(); static Deinflections deinflect(final String japanese); static Deinflections searchJpDeinflected(final String verb, final RomanizationEnum romanization);  }
@Test public void jpSearchWithDeinflect() { final SearchQuery q = VerbDeinflection.searchJpDeinflected("tabenai", RomanizationEnum.Hepburn).query; Arrays.sort(q.query); Assert.assertArrayEquals(q.query, new String[]{"たぶ", "たべる"}); }