public Dictionary(WordDictionary dictionary, Spelling spellChecker, IAnagramsEndpoint anagramsEndpoint) { _dictionary = dictionary; _spellChecker = spellChecker; _anagramsEndpoint = anagramsEndpoint; _dictionary.DictionaryFile = "en-US.dic"; _dictionary.Initialize(); _spellChecker.Dictionary = _dictionary; }
/// <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()); }