public void AddChild(Node n) { if(!dict.ContainsKey(n.c)) { dict.Add(n.c, n); } }
private void GetWords(Node node, List<string> pred) { if (pred.Count >= maxPredictions) return; foreach (char c in node.dict.Keys) { Node cur = node.getChild(c); if (cur.IsWord) { pred.Add(cur.str); if (pred.Count > maxPredictions) return; } GetWords(cur, pred); } }