コード例 #1
0
ファイル: CopyFromInput.cs プロジェクト: papeh/hermitcrab
        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.GetValue(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.GetValue(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]++;
        }