Exemplo n.º 1
0
        /// <summary>
        /// Burst the container, replace it with a node and the most common character will be the child of that node
        /// anything left will be put in containers approriately
        /// </summary>
        /// <param name="temp">container</param>
        /// <returns>a node with an array of children that are either a node or container</returns>
        public MyTrieNode BurstThisContainer(BurstNavigable temp)
        {
            MyTrieNode         node        = new MyTrieNode();
            IEnumerator <Word> _enumerator = temp.GetChildren().GetEnumerator();

            while (_enumerator.MoveNext())
            {
                node.Add(_enumerator.Current.content.ToCharArray(), 0, _enumerator.Current.pageCount);
            }
            return(node);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Add take in the character array of the word and the int page count of the page
 /// </summary>
 /// <param name="word">chracter array of the word</param>
 /// <param name="pageCount">page count of the word</param>
 public void Add(char[] word, int pageCount)
 {
     _root.Add(word, 0, pageCount);
 }