Пример #1
0
        public override void GenerateAnalysisLhs(Pattern <Word, ShapeNode> analysisLhs,
                                                 IDictionary <string, Pattern <Word, ShapeNode> > partLookup, IDictionary <string, int> capturedParts)
        {
            Pattern <Word, ShapeNode> pattern = partLookup[PartName];
            int    count     = capturedParts.GetOrCreate(PartName, () => 0);
            string groupName = AnalysisMorphologicalTransform.GetGroupName(PartName, count);

            analysisLhs.Children.Add(new Group <Word, ShapeNode>(groupName,
                                                                 pattern.Children.DeepCloneExceptBoundaries()));
            capturedParts[PartName]++;
        }
Пример #2
0
        public override void GenerateAnalysisLhs(Pattern <Word, ShapeNode> analysisLhs,
                                                 IDictionary <string, Pattern <Word, ShapeNode> > partLookup, IDictionary <string, int> capturedParts)
        {
            Pattern <Word, ShapeNode> pattern = partLookup[PartName];
            int    count     = capturedParts.GetOrCreate(PartName, () => 0);
            string groupName = AnalysisMorphologicalTransform.GetGroupName(PartName, count);
            var    group     = new Group <Word, ShapeNode>(groupName, pattern.Children.DeepCloneExceptBoundaries());

            foreach (Constraint <Word, ShapeNode> constraint in group.GetNodesDepthFirst()
                     .OfType <Constraint <Word, ShapeNode> >()
                     .Where(c => c.Type() == (FeatureSymbol)_simpleCtxt.FeatureStruct.GetValue(HCFeatureSystem.Type)))
            {
                constraint.FeatureStruct.PriorityUnion(_simpleCtxt.FeatureStruct);
            }
            analysisLhs.Children.Add(group);
            capturedParts[PartName]++;
        }