Search in sources :

Example 1 with InterpretingAnalyzer

use of zemberek.morphology._analyzer.InterpretingAnalyzer in project zemberek-nlp by ahmetaa.

the class _SingleAnalysisTest method morphemeGroupTest.

@Test
public void morphemeGroupTest() {
    InterpretingAnalyzer analyzer = getAnalyzer("kitap");
    _SingleAnalysis analysis = analyzer.analyze("kitaplarda").get(0);
    MorphemeGroup group = analysis.getGroup(0);
    Assert.assertEquals("kitaplarda", group.surface());
    analyzer = getAnalyzer("okumak");
    analysis = analyzer.analyze("okutmuyor").get(0);
    Assert.assertEquals(2, analysis.getMorphemeGroupCount());
    MorphemeGroup group0 = analysis.getGroup(0);
    Assert.assertEquals("oku", group0.surface());
    MorphemeGroup group1 = analysis.getGroup(1);
    Assert.assertEquals("tmuyor", group1.surface());
}
Also used : MorphemeGroup(zemberek.morphology._analyzer._SingleAnalysis.MorphemeGroup) Test(org.junit.Test)

Example 2 with InterpretingAnalyzer

use of zemberek.morphology._analyzer.InterpretingAnalyzer in project zemberek-nlp by ahmetaa.

the class AnalyzerTestBase method printDebug.

private static void printDebug(InterpretingAnalyzer analyzer, String input) {
    AnalysisDebugData debugData = new AnalysisDebugData();
    analyzer.analyze(input, debugData);
    debugData.dumpToConsole();
}
Also used : AnalysisDebugData(zemberek.morphology._analyzer.InterpretingAnalyzer.AnalysisDebugData)

Aggregations

Test (org.junit.Test)1 AnalysisDebugData (zemberek.morphology._analyzer.InterpretingAnalyzer.AnalysisDebugData)1 MorphemeGroup (zemberek.morphology._analyzer._SingleAnalysis.MorphemeGroup)1