// construit l'arbre public void Populate(DictionaryWord word) { if (Root == null) { Root = new TreeNode(this, word); } else { Root.AddChild(word); } }
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)); } }
public TreeNode(WordTree tree, DictionaryWord label) { Tree = tree; Label = label; }