use of zemberek.morphology.analysis.RuleBasedAnalyzer in project zemberek-nlp by ahmetaa.
the class TurkishMorphologyFunctionalTests method testAsciiTolerantMorphology.
@Test
public void testAsciiTolerantMorphology() {
// Instance with no dictionary item.
TurkishMorphology morphology = getAsciiTolerantMorphology("sıra", "şıra", "armut", "kazan", "ekonomik [P:Adj]", "insan");
RuleBasedAnalyzer analyzer = morphology.getAnalyzer();
List<SingleAnalysis> result;
result = analyzer.analyze("ekonomık");
Assert.assertTrue(containsAllDictionaryLemma(result, "ekonomik"));
result = analyzer.analyze("sira");
Assert.assertEquals(2, result.size());
Assert.assertTrue(containsAllDictionaryLemma(result, "sıra", "şıra"));
result = analyzer.analyze("siraci");
Assert.assertTrue(containsAllDictionaryLemma(result, "sıra", "şıra"));
result = analyzer.analyze("armutcuga");
Assert.assertTrue(containsAllDictionaryLemma(result, "armut"));
result = analyzer.analyze("kazancıga");
Assert.assertTrue(containsAllDictionaryLemma(result, "kazan"));
result = analyzer.analyze("kazanciga");
Assert.assertTrue(containsAllDictionaryLemma(result, "kazan"));
result = analyzer.analyze("kazançiğimizdan");
Assert.assertTrue(containsAllDictionaryLemma(result, "kazan"));
result = analyzer.analyze("ınsanların");
Assert.assertTrue(containsAllDictionaryLemma(result, "insan"));
}
Aggregations