### Question:
TurkishDictionaryLoader { public static DictionaryItem loadFromString(String dictionaryLine) { String lemma = dictionaryLine; if (dictionaryLine.contains(" ")) { lemma = dictionaryLine.substring(0, dictionaryLine.indexOf(" ")); } return load(dictionaryLine).getMatchingItems(lemma).get(0); }  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 voicingInferenceTest() { DictionaryItem item = TurkishDictionaryLoader.loadFromString("aort [A:NoVoicing]"); Assert.assertEquals("aort", item.root); Assert.assertEquals(Noun, item.primaryPos); Assert.assertTrue(item.hasAttribute(RootAttribute.NoVoicing)); Assert.assertFalse(item.hasAttribute(RootAttribute.Voicing)); item = TurkishDictionaryLoader.loadFromString("at"); Assert.assertEquals("at", item.root); Assert.assertEquals(Noun, item.primaryPos); Assert.assertTrue(item.hasAttribute(RootAttribute.NoVoicing)); Assert.assertFalse(item.hasAttribute(RootAttribute.Voicing)); }
@Test public void punctuationTest() { DictionaryItem item = TurkishDictionaryLoader.loadFromString("… [P:Punc]"); Assert.assertEquals("…", item.root); Assert.assertEquals(Punctuation, item.primaryPos); }
@Test public void properNounsShouldNotHaveVoicingAutomaticallyTest() { DictionaryItem item = TurkishDictionaryLoader.loadFromString("Tokat"); Assert.assertEquals("tokat", item.root); Assert.assertEquals(Noun, item.primaryPos); Assert.assertEquals(SecondaryPos.ProperNoun, item.secondaryPos); Assert.assertFalse(item.hasAttribute(RootAttribute.Voicing)); item = TurkishDictionaryLoader.loadFromString("Dink"); Assert.assertEquals("dink", item.root); Assert.assertEquals(Noun, item.primaryPos); Assert.assertEquals(SecondaryPos.ProperNoun, item.secondaryPos); Assert.assertFalse(item.hasAttribute(RootAttribute.Voicing)); }
@Test public void nounVoicingTest() { String[] voicing = {"kabak", "kabak [A:Voicing]", "psikolog", "havuç", "turp [A:Voicing]", "galip", "nohut", "cenk", "kükürt"}; for (String s : voicing) { DictionaryItem item = TurkishDictionaryLoader.loadFromString(s); Assert.assertEquals(Noun, item.primaryPos); Assert.assertTrue("error in:" + s, item.hasAttribute(RootAttribute.Voicing)); } String[] novoicing = {"kek", "link [A:NoVoicing]", "top", "kulp", "takat [A:NoVoicing]"}; for (String s : novoicing) { DictionaryItem item = TurkishDictionaryLoader.loadFromString(s); Assert.assertEquals(Noun, item.primaryPos); Assert.assertTrue("error in:" + s, item.hasAttribute(NoVoicing)); } }
@Test public void nounAttributesTest() { List<ItemAttrPair> testList = Lists.newArrayList( testPair("takat [A:NoVoicing, InverseHarmony]", NoVoicing, InverseHarmony), testPair("nakit [A: LastVowelDrop]", Voicing, LastVowelDrop), testPair("ret [A:Voicing, Doubling]", Voicing, Doubling) ); for (ItemAttrPair pair : testList) { DictionaryItem item = TurkishDictionaryLoader.loadFromString(pair.str); Assert.assertEquals(Noun, item.primaryPos); Assert.assertEquals("error in:" + pair.str, pair.attrs, item.attributes); } }