use of zemberek.morphology.morphotactics.StemTransition in project zemberek-nlp by ahmetaa.
the class WordGenerator method generate.
public List<Result> generate(String stem, List<String> morphemeIds) {
List<Morpheme> morphemes = new ArrayList<>();
for (String morphemeId : morphemeIds) {
Morpheme morpheme = TurkishMorphotactics.getMorpheme(morphemeId);
morphemes.add(morpheme);
}
List<StemTransition> candidates = stemTransitions.getPrefixMatches(stem, false);
return generate(stem, candidates, morphemes);
}
use of zemberek.morphology.morphotactics.StemTransition in project zemberek-nlp by ahmetaa.
the class StemEndingGraph method generateStemGraph.
private CharacterGraph generateStemGraph() {
CharacterGraph stemGraph = new CharacterGraph();
StemTransitions stemTransitions = morphology.getMorphotactics().getStemTransitions();
for (StemTransition transition : stemTransitions.getTransitions()) {
if (transition.surface.length() == 0 || transition.item.primaryPos == PrimaryPos.Punctuation) {
continue;
}
stemGraph.addWord(transition.surface, Node.TYPE_WORD);
}
return stemGraph;
}
Aggregations