use of zemberek.morphology.lexicon.graph.DynamicLexiconGraph in project zemberek-nlp by ahmetaa.
the class WordAnalysisTest method getParser.
private WordAnalyzer getParser(String... lines) {
DynamicLexiconGraph graph = new DynamicLexiconGraph(suffixProvider);
graph.addDictionaryItems(new TurkishDictionaryLoader().load(lines));
return new WordAnalyzer(graph);
}
use of zemberek.morphology.lexicon.graph.DynamicLexiconGraph in project zemberek-nlp by ahmetaa.
the class WordAnalyzerFunctionalTest method getLexiconGraph.
private DynamicLexiconGraph getLexiconGraph(File... dictionaries) throws IOException {
SuffixProvider suffixProvider = suffixes;
RootLexicon lexicon = new RootLexicon();
for (File dictionary : dictionaries) {
new TurkishDictionaryLoader().loadInto(lexicon, dictionary);
}
DynamicLexiconGraph graph = new DynamicLexiconGraph(suffixProvider);
graph.addDictionaryItems(lexicon);
return graph;
}
use of zemberek.morphology.lexicon.graph.DynamicLexiconGraph in project zemberek-nlp by ahmetaa.
the class WordAnalyzerTest method getLexiconGraph.
private DynamicLexiconGraph getLexiconGraph(String... words) {
SuffixProvider suffixProvider = new NounSuffixes();
List<DictionaryItem> items = getItems(words);
DynamicLexiconGraph graph = new DynamicLexiconGraph(suffixProvider);
graph.addDictionaryItems(items);
return graph;
}
use of zemberek.morphology.lexicon.graph.DynamicLexiconGraph in project zemberek-nlp by ahmetaa.
the class WordAnalyzerTest method testDoubling.
@Test
public void testDoubling() {
DynamicLexiconGraph graph = getLexiconGraph("ret [A:Voicing, Doubling]");
assertHasParses(graph, "ret", "retler", "redde");
assertUnParseable(graph, "rede", "rete", "redler", "red");
}
use of zemberek.morphology.lexicon.graph.DynamicLexiconGraph in project zemberek-nlp by ahmetaa.
the class WordAnalyzerTest method testCompounds.
@Test
public void testCompounds() {
DynamicLexiconGraph graph = getLexiconGraph("zeytinyağı [A:CompoundP3sg ;Roots:zeytin-yağ]");
assertHasParses(graph, "zeytinyağım", "zeytinyağına", "zeytinyağı", "zeytinyağcık", "zeytinyağcığa", "zeytinyağlarım");
assertUnParseable(graph, "zeytinyağıcık", "zeytinyağılar");
}
Aggregations