Example #1
0
        public static SuffixNode CreateNode(int start, EndIndex endIndex)
        {
            SuffixNode node = new SuffixNode();

            node.Start    = start;
            node.EndIndex = endIndex;
            return(node);
        }
Example #2
0
        public void Build()
        {
            this._root                 = SuffixNode.CreateNode(1, new EndIndex(0));
            this._root.Index           = -1;
            this._activePoint          = new ActivePoint(this._root);
            this._globalEndIndex       = new EndIndex(-1);
            this._remainingSuffixCount = 0;
            for (var i = 0; i < this._input.Length; i++)
            {
                this.StartPhase(i);
            }

            if (this._remainingSuffixCount != 0)
            {
                Console.WriteLine("Something went wrong!");
            }

            this.SetIndexUsingDfs(this._root, 0, this._input.Length);
        }