예제 #1
0
        public Dictionary(WordDictionary dictionary, Spelling spellChecker, IAnagramsEndpoint anagramsEndpoint)
        {
            _dictionary                = dictionary;
            _spellChecker              = spellChecker;
            _anagramsEndpoint          = anagramsEndpoint;
            _dictionary.DictionaryFile = "en-US.dic";

            _dictionary.Initialize();
            _spellChecker.Dictionary = _dictionary;
        }
예제 #2
0
 /// <summary>
 /// Constructor when not using DI
 /// </summary>
 public Dictionary()
 {
     // Choose what dictionary to use.
     _dictionary = new WordDictionary
     {
         //_dictionary.DictionaryFile = "en-US.dic";
         DictionaryFile = "en-GB.dic"
     };
     _dictionary.Initialize();
     // Set the spell checker with a dictionary.
     _spellChecker = new Spelling
     {
         Dictionary = _dictionary
     };
     // Initialize the anagrams endpoint and pass in the api helper.
     _anagramsEndpoint = new AnagramsEndpoint(new APIHelper());
 }