Пример #1
0
        private AhoCorasickTreeNode GetTransition(char c, ref AhoCorasickTreeNode pointer)
        {
            AhoCorasickTreeNode transition = null;

            while (transition == null)
            {
                transition = pointer.GetTransition(c);

                if (pointer == Root)
                {
                    break;
                }

                if (transition == null)
                {
                    pointer = pointer.Failure;
                }
            }
            return(transition);
        }