Пример #1
0
    public bool Add(Difference difference, int startIndex)
    {
        if (startIndex == difference.Length)
        {
            if (EndOfWord)
            {
                return(false);
            }

            EndOfWord = true;
            return(true);
        }

        DifferenceNode child;
        char           c = difference.CharAt(startIndex);

        if (!Children.TryGetValue(c, out child))
        {
            child = new DifferenceNode();
            Children.Add(c, child);
        }

        var result = child.Add(difference, startIndex + 1);

        return(result);
    }