Search in sources :

Example 16 with PhoneticAttribute

use of zemberek.core.turkish.PhoneticAttribute in project zemberek-nlp by ahmetaa.

the class StemTransitionsBase method generate.

/**
 * Generates StemTransition objects from the dictionary item. <p>Most of the time a single
 * StemNode is generated.
 *
 * @param item DictionaryItem
 * @return one or more StemTransition objects.
 */
public List<StemTransition> generate(DictionaryItem item) {
    if (specialRoots.contains(item.id)) {
        return handleSpecialRoots(item);
    }
    if (hasModifierAttribute(item)) {
        return generateModifiedRootNodes(item);
    } else {
        AttributeSet<PhoneticAttribute> phoneticAttributes = calculateAttributes(item.pronunciation);
        StemTransition transition = new StemTransition(item.root, item, phoneticAttributes, morphotactics.getRootState(item, phoneticAttributes));
        return Lists.newArrayList(transition);
    }
}
Also used : StemTransition(zemberek.morphology.morphotactics.StemTransition) PhoneticAttribute(zemberek.core.turkish.PhoneticAttribute)

Aggregations

PhoneticAttribute (zemberek.core.turkish.PhoneticAttribute)16 TurkicLetter (zemberek.core.turkish.TurkicLetter)6 ArrayList (java.util.ArrayList)4 PhoneticExpectation (zemberek.core.turkish.PhoneticExpectation)3 RootAttribute (zemberek.core.turkish.RootAttribute)3 StemTransition (zemberek.morphology._morphotactics.StemTransition)3 LexiconException (zemberek.morphology.lexicon.LexiconException)3 StemNode (zemberek.morphology.lexicon.graph.StemNode)3 StemTransition (zemberek.morphology.morphotactics.StemTransition)3 TurkishLetterSequence (zemberek.core.turkish.TurkishLetterSequence)2 MorphemeState (zemberek.morphology._morphotactics.MorphemeState)2 RejectedTransition (zemberek.morphology.analysis.AnalysisDebugData.RejectedTransition)2 SuffixTemplateToken (zemberek.morphology.analysis.SurfaceTransition.SuffixTemplateToken)2 SuffixData (zemberek.morphology.lexicon.graph.SuffixData)2 CombinedCondition (zemberek.morphology.morphotactics.CombinedCondition)2 Condition (zemberek.morphology.morphotactics.Condition)2 MorphemeState (zemberek.morphology.morphotactics.MorphemeState)2 MorphemeTransition (zemberek.morphology.morphotactics.MorphemeTransition)2 SuffixTransition (zemberek.morphology.morphotactics.SuffixTransition)2 EnumSet (java.util.EnumSet)1