/// <summary>
        /// Recursively builds a phrase structure tree from the given word.
        /// </summary>
        /// <param name="words">The array of words that make up the phrase</param>
        /// <returns>The sentence structured into a hierarchical tree</returns>
        public static Phrase buildTree(string InputPhrase, Lexicon d)
        {
            String[] words = processPhrase(InputPhrase);

            Terminal[] terminals = new Terminal[words.Length];

            for (int i = 0; i < words.Length; i++)
            {
                terminals[i] = new Terminal(words[i], d.lookupCategory(words[i]));
            }

            return merge(terminals);
        }