CMUdict implements PronouncingDictionary { @SuppressWarnings("unchecked") @Override public List<String> getPronunciations(String word) throws PronouncingDictionaryException { return (List<String>) dict.get(word.toUpperCase()); } CMUdict();  CMUdict(Reader reader); @Override String getDictionaryId(); @SuppressWarnings("unchecked") @Override List<String> getPronunciations(String word); @Override String getAlphabetId(); @Override String getLanguage();  }
@Test public void cmuTest() throws IOException, PronouncingDictionaryException { CMUdict dict = new CMUdict(); List<String> result; result = dict.getPronunciations("ab"); assertEquals(2, result.size()); assertEquals("AE1 B", result.get(0)); assertEquals("EY1 B IY1", result.get(1)); result = dict.getPronunciations("foobarbaz"); assertNull(result); }