Search in sources :

Example 6 with NullSuffixForm

use of zemberek.morphology.lexicon.NullSuffixForm in project zemberek-nlp by ahmetaa.

the class DynamicSuffixProviderTest method testNullSets.

@Test
public void testNullSets() {
    DynamicSuffixProvider provider = new TestSuffixProvider();
    Suffix sf1 = new Suffix("sf1");
    Suffix sf2 = new Suffix("sf2");
    Suffix sf3 = new Suffix("sf3");
    Suffix sf4 = new Suffix("sf4");
    SuffixForm set1 = new SuffixForm(1, "fs1", sf1, "abc");
    SuffixForm set2_1 = new SuffixForm(2, "fs2-1", sf2, "ali");
    SuffixForm set2_2 = new SuffixForm(3, "fs2-2", sf2, "kaan");
    SuffixForm set4 = new SuffixForm(4, "fs4", sf4, "akin");
    SuffixFormTemplate tmp1 = new SuffixFormTemplate(5, "tmp1", sf3, TerminationType.TRANSFER);
    // 
    // set4 -.........->set2_2
    // \       /
    // set1--->tmp1-/
    // |           \
    // .............-> set2_1        --- Direct link  ... indirect link.
    set1.connections.add(tmp1);
    set1.indirectConnections.add(set2_2);
    set4.connections.add(tmp1);
    set4.indirectConnections.add(set2_1);
    tmp1.connections.add(set2_1);
    tmp1.connections.add(set2_2);
    NullSuffixForm null1 = provider.generateNullFormFromTemplate(tmp1, new SuffixData(set2_2));
    NullSuffixForm null1Repeat = provider.generateNullFormFromTemplate(tmp1, new SuffixData(set2_2));
    Assert.assertEquals(null1, null1Repeat);
}
Also used : Suffix(zemberek.morphology.lexicon.Suffix) SuffixForm(zemberek.morphology.lexicon.SuffixForm) NullSuffixForm(zemberek.morphology.lexicon.NullSuffixForm) NullSuffixForm(zemberek.morphology.lexicon.NullSuffixForm) SuffixFormTemplate(zemberek.morphology.lexicon.SuffixFormTemplate) Test(org.junit.Test)

Aggregations

NullSuffixForm (zemberek.morphology.lexicon.NullSuffixForm)6 SuffixForm (zemberek.morphology.lexicon.SuffixForm)4 SuffixFormTemplate (zemberek.morphology.lexicon.SuffixFormTemplate)4 Test (org.junit.Test)3 ArrayList (java.util.ArrayList)2 Splitter (com.google.common.base.Splitter)1 Stopwatch (com.google.common.base.Stopwatch)1 HashMultimap (com.google.common.collect.HashMultimap)1 LinkedHashMultimap (com.google.common.collect.LinkedHashMultimap)1 Lists (com.google.common.collect.Lists)1 Multimap (com.google.common.collect.Multimap)1 IOException (java.io.IOException)1 PrintWriter (java.io.PrintWriter)1 StandardCharsets (java.nio.charset.StandardCharsets)1 Files (java.nio.file.Files)1 Path (java.nio.file.Path)1 Paths (java.nio.file.Paths)1 Collator (java.text.Collator)1 Collection (java.util.Collection)1 Comparator (java.util.Comparator)1