public WordCorrectness IsCorrect(string word) { // First check the case-sensitive dictionary. bool isCaseSensitiveCorrect = CaseSensitiveDictionary.Contains(word); if (isCaseSensitiveCorrect) { return(WordCorrectness.Correct); } // Check the case-insensitive version by making it lowercase and trying // again. word = word.ToLowerInvariant(); bool isCaseInsensitiveCorrect = CaseInsensitiveDictionary.Contains(word); // The return value is either correct or indeterminate since this // plugin is intended to be a supplemental spell-checking instead of // a conclusive one. return(isCaseInsensitiveCorrect ? WordCorrectness.Correct : WordCorrectness.Indeterminate); }