KanjidicEntry extends DictEntry { public List<String> getOnyomi() { final List<String> result = new ArrayList<String>(); for (final String o : reading.split(",")) { final String oo = o.trim(); if (oo.length() == 0) { continue; } if (!KanjiUtils.isKatakana(oo.charAt(0))) { break; } result.add(oo); } return result; } KanjidicEntry(final String kanji, final String reading, final String english, final int radical, final int strokes, final String skip, final Integer grade); Integer getJlpt(); char getKanji(); List<String> getOnyomi(); List<String> getKunyomi(); List<String> getNamae(); List<String> getEnglish(); static String removeSplits(final String str); final int radical; final int strokes; final String skip; final Integer grade; }
@Test public void testOnyomi() { assertArrayEquals(test1().getOnyomi(), Arrays.asList("アイ")); assertArrayEquals(test2().getOnyomi(), Arrays.asList("ホウ")); assertArrayEquals(test3().getOnyomi(), Arrays.asList("ホ ウ")); }