예제 #1
0
 public SynthesisRealizationalAffixProcessRule(Morpher morpher, RealizationalAffixProcessRule rule)
 {
     _morpher = morpher;
     _rule    = rule;
     _rules   = new List <PatternRule <Word, ShapeNode> >();
     foreach (AffixProcessAllomorph allo in rule.Allomorphs)
     {
         _rules.Add(new PatternRule <Word, ShapeNode>(new SynthesisAffixProcessAllomorphRuleSpec(allo),
                                                      new MatcherSettings <ShapeNode>
         {
             Filter = ann => ann.Type().IsOneOf(HCFeatureSystem.Segment, HCFeatureSystem.Boundary) &&
                      !ann.IsDeleted(),
             AnchoredToStart = true,
             AnchoredToEnd   = true
         }));
     }
 }
예제 #2
0
        public AnalysisRealizationalAffixProcessRule(Morpher morpher, RealizationalAffixProcessRule rule)
        {
            _morpher = morpher;
            _rule    = rule;

            _rules = new List <PatternRule <Word, ShapeNode> >();
            foreach (AffixProcessAllomorph allo in rule.Allomorphs)
            {
                _rules.Add(new MultiplePatternRule <Word, ShapeNode>(new AnalysisAffixProcessAllomorphRuleSpec(allo),
                                                                     new MatcherSettings <ShapeNode>
                {
                    Filter          = ann => ann.Type() == HCFeatureSystem.Segment,
                    MatchingMethod  = MatchingMethod.Unification,
                    AnchoredToStart = true,
                    AnchoredToEnd   = true,
                    AllSubmatches   = true
                }));
            }
        }