### Question:
TurkishDictionaryLoader { public static RootLexicon load(File input) throws IOException { return Files.asCharSource(input, Charsets.UTF_8).readLines(new TextLexiconProcessor()); }  static RootLexicon loadDefaultDictionaries(); static RootLexicon loadFromResources(String... resourcePaths); static RootLexicon loadFromResources(Collection<String> resourcePaths); static RootLexicon load(File input); static RootLexicon loadInto(RootLexicon lexicon, File input); static DictionaryItem loadFromString(String dictionaryLine); static RootLexicon load(String... dictionaryLines); static RootLexicon load(Iterable<String> dictionaryLines); static final List<String> DEFAULT_DICTIONARY_RESOURCES; }### Answer:
@Test public void loadNounsFromFileTest() throws IOException { RootLexicon items = TurkishDictionaryLoader .load(new File(Resources.getResource("test-lexicon-nouns.txt").getFile())); Assert.assertFalse(items.isEmpty()); for (DictionaryItem item : items) { Assert.assertSame(item.primaryPos, Noun); } }
@Test public void referenceTest1() { String[] ref = {"ad", "ad [A:Doubling,InverseHarmony]", "soy", "soyadı [A:CompoundP3sg; Roots:soy-ad]"}; RootLexicon lexicon = TurkishDictionaryLoader.load(ref); DictionaryItem item = lexicon.getItemById("soyadı_Noun"); Assert.assertNotNull(item); Assert.assertFalse(item.attributes.contains(RootAttribute.Doubling)); }
@Test public void referenceTest2() { String[] ref = {"ad", "ad [A:Doubling,InverseHarmony;Index:1]", "soy", "soyadı [A:CompoundP3sg; Roots:soy-ad]"}; RootLexicon lexicon = TurkishDictionaryLoader.load(ref); DictionaryItem item = lexicon.getItemById("soyadı_Noun"); Assert.assertNotNull(item); Assert.assertFalse(item.attributes.contains(RootAttribute.Doubling)); }
@Test public void pronunciation1() { String[] ref = { "VST [P:Noun, Abbrv; Pr:viesti]", "VST [P:Noun, Abbrv; Pr:vesete; Ref:VST_Noun_Abbrv; Index:2]"}; RootLexicon lexicon = TurkishDictionaryLoader.load(ref); DictionaryItem item = lexicon.getItemById("VST_Noun_Abbrv"); Assert.assertNotNull(item); DictionaryItem item2 = lexicon.getItemById("VST_Noun_Abbrv_2"); Assert.assertNotNull(item2); Assert.assertEquals(item, item2.getReferenceItem()); }
@Test public void implicitP3sgTest() { String[] lines = { "üzeri [A:CompoundP3sg;Roots:üzer]"}; RootLexicon lexicon = TurkishDictionaryLoader.load(lines); Assert.assertEquals(2, lexicon.size()); }
@Test @Ignore("Not a unit test") public void shouldPrintItemsInDevlDictionary() throws IOException { RootLexicon items = TurkishDictionaryLoader .load(new File(Resources.getResource("dev-lexicon.txt").getFile())); for (DictionaryItem item : items) { System.out.println(item); } }