示例#1
0
        static SuffixTreeNode BuildCore(SuffixGroup group, int index)
        {
            if (group.Size == 1)
            {
                return(new SuffixTreeNode(index, true));
            }

            SuffixTreeNode node = new SuffixTreeNode(-1, false);

            foreach (SuffixGroup subGroup in group.BuildGroups())
            {
                string      prefix;
                SuffixGroup reducedGroup = subGroup.Reduce(out prefix);
                node.AddChild(prefix, BuildCore(reducedGroup, index - prefix.Length));
            }
            return(node);
        }
示例#2
0
        public override bool Equals(object obj)
        {
            SuffixGroup other = obj as SuffixGroup;

            return(other != null && Enumerable.SequenceEqual(suffixes, other.suffixes));
        }