示例#1
0
 public void AddChild(Node n)
 {
     if(!dict.ContainsKey(n.c))
     {
         dict.Add(n.c, n);
     }
 }
示例#2
0
        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);
            }
        }