Search in sources :

Example 6 with Result

use of zemberek.morphology.generator.WordGenerator.Result in project zemberek-nlp by ahmetaa.

the class WordGeneratorTest method testGeneration5.

@Test
public void testGeneration5() {
    TurkishMorphotactics mo = getMorphotactics("yapmak");
    WordGenerator wordGenerator = new WordGenerator(mo);
    List<String> morphemes = Lists.newArrayList("Verb", "Opt", "A1pl");
    DictionaryItem item = mo.getRootLexicon().getItemById("yapmak_Verb");
    List<Result> results = wordGenerator.generate(item, TurkishMorphotactics.getMorphemes(morphemes));
    Assert.assertTrue(results.size() > 0);
    Assert.assertEquals("yapalım", results.get(0).surface);
}
Also used : DictionaryItem(zemberek.morphology.lexicon.DictionaryItem) TurkishMorphotactics(zemberek.morphology.morphotactics.TurkishMorphotactics) Result(zemberek.morphology.generator.WordGenerator.Result) Test(org.junit.Test)

Aggregations

Result (zemberek.morphology.generator.WordGenerator.Result)6 DictionaryItem (zemberek.morphology.lexicon.DictionaryItem)4 TurkishMorphology (zemberek.morphology.TurkishMorphology)3 Test (org.junit.Test)2 SingleAnalysis (zemberek.morphology.analysis.SingleAnalysis)2 WordAnalysis (zemberek.morphology.analysis.WordAnalysis)2 TurkishMorphotactics (zemberek.morphology.morphotactics.TurkishMorphotactics)2 ArrayList (java.util.ArrayList)1 LinkedHashSet (java.util.LinkedHashSet)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 Stream (java.util.stream.Stream)1 WordGenerator (zemberek.morphology.generator.WordGenerator)1 Token (zemberek.tokenization.Token)1