Beispiel #1
0
 // construit l'arbre
 public void Populate(DictionaryWord word)
 {
     if (Root == null)
     {
         Root = new TreeNode(this, word);
     }
     else
     {
         Root.AddChild(word);
     }
 }
Beispiel #2
0
        public void AddChild(DictionaryWord word)
        {
            int      distance = Tree.TreeBuildingWordComparer.Compare(word.Word, Label.Word);
            TreeNode child;

            if (m_children.TryGetValue(distance, out child))
            {
                child.AddChild(word);
            }
            else
            {
                m_children.Add(distance, new TreeNode(Tree, word));
            }
        }
Beispiel #3
0
 public TreeNode(WordTree tree, DictionaryWord label)
 {
     Tree  = tree;
     Label = label;
 }