当前位置: 首页>>代码示例>>C#>>正文


C# Match.ExpandMCSMatch方法代码示例

本文整理汇总了C#中Match.ExpandMCSMatch方法的典型用法代码示例。如果您正苦于以下问题:C# Match.ExpandMCSMatch方法的具体用法?C# Match.ExpandMCSMatch怎么用?C# Match.ExpandMCSMatch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Match的用法示例。


在下文中一共展示了Match.ExpandMCSMatch方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetMaxCommonFragmentsNotUsed

        public bool GetMaxCommonFragmentsNotUsed(HasseNode Node1, HasseNode Node2, bool dbg,
            HasseFragmentInsertionQueue NewFragmentList, int MinimumOverlap)
        {
            // this Node is directly below both Node1 and Node2
            // it can match several places
            CountMCS ++;
            string strSeed = this.KeyString.Replace("*", "");
            string str1 = Node1.KeyString;
            string str2 = Node2.KeyString;
            bool FoundMCS = false;
            // we are only interested in matches strictly larger than seed
            if (strSeed.Length + 1 > MinimumOverlap) { MinimumOverlap = strSeed.Length + 1; }

            int MatchPosA = GetNextMatch(0,strSeed,str1);
            while(MatchPosA>-1){
                int MatchPosB = GetNextMatch(0,strSeed,str2);
                while(MatchPosB>-1){

                    Match M = new Match( strSeed,MatchPosA, 0, str1, MatchPosB, 0, str2);
                    M.ExpandMCSMatch();
                    //MatchPosA= M.LastPosInA;
                    //MatchPosB = M.LastPosInB;
                    string debugInfo = "MCS " + Node1.GetID().ToString () + " " + Node2.GetID().ToString ();
                    if (true == ProcessMatch(M, MinimumOverlap, NewFragmentList, new HasseNode[2] { Node1, Node2 }, debugInfo))
                    { FoundMCS = true; }
                    MatchPosB = GetNextMatch(MatchPosB +1,strSeed,str2);
                }
                MatchPosA = GetNextMatch(MatchPosA +1,strSeed,str1);
            }

            return FoundMCS;
        }
开发者ID:peter-lind,项目名称:hasse-manager,代码行数:32,代码来源:StringHasseNode.cs


注:本文中的Match.ExpandMCSMatch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。