コード例 #1
0
        private void SplitMatchingBlock(MatchingBlock oldmb, int startpoint, int length, AbstractWordmatch wordmatch)
        {
            int oldstart = oldmb.startpoint;
            int oldlenth = oldmb.length;

            m_matchblocklist.Remove(oldmb);
            m_matchblocklist.Add(new MatchingBlock(wordmatch, startpoint, length));

            if (oldstart < startpoint)
            {
                m_matchblocklist.Add(new MatchingBlock(null, oldstart, startpoint - oldstart));
            }

            if ((oldstart + oldlenth) > (startpoint + length))
            {
                m_matchblocklist.Add(new MatchingBlock(null, startpoint + length, oldstart + oldlenth - startpoint - length));
            }
        }
コード例 #2
0
 public string MatchingBlockGetString(MatchingBlock mb)
 {
     return(m_string.Substring(mb.startpoint, mb.length));
 }
コード例 #3
0
 public bool AddMatchingBlock(AbstractWordmatch wordmatch, MatchingBlock oldmb, int relativestartpoint, int length)
 {
     return(this.AddMatchingBlock(wordmatch, oldmb.startpoint + relativestartpoint, length));
 }