/// <summary>
        /// Get the object that was inserted under the keyword.
        /// </summary>
        /// <value>The object that was inserted under the keyword.</value>
        /// <remarks>
        /// <para>
        /// The keyword is taken from an <see cref="IDocument"/> at a given location
        /// (line, offset in line, length).
        /// </para>
        /// <para>
        /// Returns <c>null</c>, if no such keyword exists.
        /// </para>
        /// </remarks>
        public object this[IDocument document, LineSegment line, int offsetInLine, int lengthOfWord]
        {
            get
            {
                if (lengthOfWord == 0)
                {
                    return(null);
                }

                Node next = _root;

                int wordOffset = line.Offset + offsetInLine;
                if (_caseSensitive)
                {
                    for (int i = 0; i < lengthOfWord; ++i)
                    {
                        int index = document.GetCharAt(wordOffset + i) % 256;
                        next = next[index];

                        if (next == null)
                        {
                            return(null);
                        }

                        if (next.Color != null && TextHelper.CompareSegment(document, wordOffset, lengthOfWord, next.Word))
                        {
                            return(next.Color);
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < lengthOfWord; ++i)
                    {
                        int index = Char.ToUpper(document.GetCharAt(wordOffset + i)) % 256;

                        next = next[index];

                        if (next == null)
                        {
                            return(null);
                        }

                        if (next.Color != null && TextHelper.CompareSegment(document, wordOffset, lengthOfWord, next.Word, _caseSensitive))
                        {
                            return(next.Color);
                        }
                    }
                }
                return(null);
            }
        }