Insert() public method

public Insert ( string word, int freq = 1 ) : int
word string
freq int
return int
Exemplo n.º 1
0
 private Trie GetWordDictTrie()
 {
     var wordDict = WordDictionary.Instance;
     var trie = new Trie();
     foreach (var wd in wordDict.Trie)
     {
         if (wd.Value > 0)
         {
             trie.Insert(wd.Key, wd.Value);
         }
     }
     return trie;
 }
Exemplo n.º 2
0
        private Trie GetTestTrie()
        {
            var trie = new Trie();
            trie.Insert("ann");
            trie.Insert("anders", 5);
            trie.Insert("andy", 10);

            trie.Insert("bill");
            trie.Insert("candy");
            trie.Insert("dove");

            return trie;
        }