public IActionResult AnagramFinder([FromQuery] string word) { IMatchingWordFinder matchingWordFinder = new MatchingAnagramFinder(); var matching = matchingWordFinder.FindMatching(word, config["dictionaryFileName"]); if (matching.Count() == 0) { return(NotFound()); } return(Ok(matching)); }
static void GetKnownAnagram(IEnumerable <string> words) { if (words.Count() < 1) { Console.WriteLine("GETKNOWN: oen word is required for getting known anagrams"); return; } IMatchingWordFinder matchingWordFinder = new MatchingAnagramFinder(); var matching = matchingWordFinder.FindMatching(words.ElementAt(0), dictionaryFileName); if (matching.Count() == 0) { Console.WriteLine("GETKNOWN: no anagrams found"); } else { Console.WriteLine("GETKNOWN: (" + words.ElementAt(0) + "): " + IEnumerableAsString(matching)); } }