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);
}
Aggregations