Ejemplo n.º 1
0
        private void SetRootAllomorph(RootAllomorph rootAllomorph)
        {
            _rootAllomorph = rootAllomorph;
            var entry = (LexEntry)_rootAllomorph.Morpheme;

            Stratum = entry.Stratum;
            MarkMorph(_shape, _rootAllomorph);
            SyntacticFeatureStruct = entry.SyntacticFeatureStruct.Clone();
            _mprFeatures.Clear();
            _mprFeatures.UnionWith(entry.MprFeatures);
            _isPartial = entry.IsPartial;
        }
Ejemplo n.º 2
0
        public void Add(RootAllomorph allomorph)
        {
            _allomorphs[allomorph.ID] = allomorph;
            ShapeNode first = allomorph.Segments.Shape.GetFirst(n => _filter(n.Annotation));

            if (first == allomorph.Segments.Shape.End)
            {
                _fsa.StartState.Arcs.Add(_fsa.CreateAcceptingState(allomorph.ID, (s, match) => true, _shapeCount));
            }
            else
            {
                AddNode(first, _fsa.StartState, allomorph.ID);
            }
            _shapeCount++;
        }
Ejemplo n.º 3
0
 public Word(RootAllomorph rootAllomorph, FeatureStruct realizationalFS)
 {
     _allomorphs  = new Dictionary <string, Allomorph>();
     _mprFeatures = new MprFeatureSet();
     _shape       = rootAllomorph.Segments.Shape.Clone();
     ResetDirty();
     SetRootAllomorph(rootAllomorph);
     RealizationalFeatureStruct = realizationalFS;
     _mruleApps                   = new List <IMorphologicalRule>();
     _mrulesUnapplied             = new Dictionary <IMorphologicalRule, int>();
     _mrulesApplied               = new Dictionary <IMorphologicalRule, int>();
     _nonHeadApps                 = new List <Word>();
     _obligatorySyntacticFeatures = new IDBearerSet <Feature>();
     _isLastAppliedRuleFinal      = null;
 }
Ejemplo n.º 4
0
 protected Word(Word word)
 {
     _allomorphs                  = new Dictionary <string, Allomorph>(word._allomorphs);
     Stratum                      = word.Stratum;
     _shape                       = word._shape.Clone();
     _rootAllomorph               = word._rootAllomorph;
     SyntacticFeatureStruct       = word.SyntacticFeatureStruct.Clone();
     RealizationalFeatureStruct   = word.RealizationalFeatureStruct.Clone();
     _mprFeatures                 = word.MprFeatures.Clone();
     _mruleApps                   = new List <IMorphologicalRule>(word._mruleApps);
     _mruleAppIndex               = word._mruleAppIndex;
     _mrulesUnapplied             = new Dictionary <IMorphologicalRule, int>(word._mrulesUnapplied);
     _mrulesApplied               = new Dictionary <IMorphologicalRule, int>(word._mrulesApplied);
     _nonHeadApps                 = new List <Word>(word._nonHeadApps.CloneItems());
     _nonHeadAppIndex             = word._nonHeadAppIndex;
     _obligatorySyntacticFeatures = new IDBearerSet <Feature>(word._obligatorySyntacticFeatures);
     _isLastAppliedRuleFinal      = word._isLastAppliedRuleFinal;
     _isPartial                   = word._isPartial;
     CurrentTrace                 = word.CurrentTrace;
 }