Segmenter.Base.Sequences.ComplexChain.JoinAll C# (CSharp) Method

JoinAll() public method

Joins all hits from start chain to whole composed string Very fast for long sequence, because there is no index check!
public JoinAll ( List word ) : void
word List list of letters to compose
return void
        public void JoinAll(List<string> word)
        {
            int length = word.Count;
            int index = 0;
            while (true)
            {
                try
                {
                    if (ToList().GetRange(index, length - index).Equals(word))
                    {
                        Join(index, length);
                    }

                    index++;
                }
                catch (Exception)
                {
                    return;
                }
            }
        }

Usage Example

コード例 #1
0
 public void JoinAllTest()
 {
     var list1 = new List<string> { "A", "A", "G", "G", "T", "G", "C", "A", "A", "A", "A", "T", "A", "T", "A", "A", "A" };
     var clon = new ComplexChain(list1);
     var list2 = new List<string> { "A", "A" };
     clon.JoinAll(list2);
 }