Search in sources :

Example 16 with DynamicLexiconGraph

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

the class WordAnalyzerTest method testVoicing.

@Test
public void testVoicing() {
    DynamicLexiconGraph graph = getLexiconGraph("armut");
    assertHasParses(graph, "armut", "armuda", "armutlar", "armutlara");
    assertUnParseable(graph, "armud", "armuta", "armudlar");
}
Also used : DynamicLexiconGraph(zemberek.morphology.lexicon.graph.DynamicLexiconGraph) Test(org.junit.Test)

Example 17 with DynamicLexiconGraph

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

the class WordAnalyzerTest method testVowelDrop.

@Test
public void testVowelDrop() {
    DynamicLexiconGraph graph = getLexiconGraph("ağız [A: LastVowelDrop]", "nakit [A:LastVowelDrop]", "vakit [A:LastVowelDrop, NoVoicing]");
    assertHasParses(graph, "vakitlere", "ağza", "ağız", "ağızlar", "nakit", "nakitlere", "nakde", "vakit", "vakte");
    assertUnParseable(graph, "ağz", "ağıza", "ağzlar", "nakd", "nakt", "nakite", "nakda", "vakide", "vakda", "vakite", "vakt");
}
Also used : DynamicLexiconGraph(zemberek.morphology.lexicon.graph.DynamicLexiconGraph) Test(org.junit.Test)

Example 18 with DynamicLexiconGraph

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

the class WordAnalyzerTest method testSuffixNonDeterminism.

@Test
public void testSuffixNonDeterminism() {
    DynamicLexiconGraph graph = getLexiconGraph("elma");
    assertHasParses(graph, "elmacığa", "elmacık");
    assertUnParseable(graph, "elmacığ", "elmacıka", "elmamcık", "elmayacık", "elmalarcık");
}
Also used : DynamicLexiconGraph(zemberek.morphology.lexicon.graph.DynamicLexiconGraph) Test(org.junit.Test)

Example 19 with DynamicLexiconGraph

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

the class WordAnalyzerTest method testCompoundsVoicing.

@Test
public void testCompoundsVoicing() {
    DynamicLexiconGraph graph = getLexiconGraph("at [A:NoVoicing]", "kuyruk", "atkuyruğu [A:CompoundP3sg; Roots:at-kuyruk]");
    assertHasParses(graph, "atkuyruğu", "atkuyruklarım", "atkuyrukçuk");
    assertUnParseable(graph, "atkuyruğlarım", "atkuyruk");
}
Also used : DynamicLexiconGraph(zemberek.morphology.lexicon.graph.DynamicLexiconGraph) Test(org.junit.Test)

Example 20 with DynamicLexiconGraph

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

the class SimpleGeneratorTest method getLexicon.

private DynamicLexiconGraph getLexicon() throws IOException {
    RootLexicon items = new TurkishDictionaryLoader().load(new File(Resources.getResource("dev-lexicon.txt").getFile()));
    DynamicLexiconGraph graph = new DynamicLexiconGraph(suffixProvider);
    graph.addDictionaryItems(items);
    return graph;
}
Also used : TurkishDictionaryLoader(zemberek.morphology.lexicon.tr.TurkishDictionaryLoader) RootLexicon(zemberek.morphology.lexicon.RootLexicon) File(java.io.File) DynamicLexiconGraph(zemberek.morphology.lexicon.graph.DynamicLexiconGraph)

Aggregations

DynamicLexiconGraph (zemberek.morphology.lexicon.graph.DynamicLexiconGraph)20 Test (org.junit.Test)14 File (java.io.File)5 WordAnalysis (zemberek.morphology.analysis.WordAnalysis)5 WordAnalyzer (zemberek.morphology.analysis.WordAnalyzer)5 SimpleGenerator (zemberek.morphology.generator.SimpleGenerator)5 TurkishDictionaryLoader (zemberek.morphology.lexicon.tr.TurkishDictionaryLoader)5 RootLexicon (zemberek.morphology.lexicon.RootLexicon)3 SuffixProvider (zemberek.morphology.lexicon.SuffixProvider)3 ArrayList (java.util.ArrayList)2 Ignore (org.junit.Ignore)1 DictionaryItem (zemberek.morphology.lexicon.DictionaryItem)1 Suffix (zemberek.morphology.lexicon.Suffix)1 DynamicSuffixProvider (zemberek.morphology.lexicon.graph.DynamicSuffixProvider)1 TurkishSuffixes (zemberek.morphology.lexicon.tr.TurkishSuffixes)1 WordParser (zemberek.morphology.parser.WordParser)1