Created
September 12, 2019 03:11
-
-
Save IntegerMan/22a491b508c861765c5f46064bf145b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Option<ResumeKeyword> GetKeyword( | |
IDictionary<string, ResumeKeyword> keywords, | |
string word) { | |
// Ensure we're searching for a lower-cased non-null word | |
string key = word ?? word.ToLowerInvariant() : string.Empty; | |
// If the keyword is present, return it | |
if (keywords.ContainsKey(key)) { | |
return keywords[key]; // Implicitly converted to Some<ResumeKeyword> | |
} | |
// No keyword found | |
return Option<ResumeKeyword>.None; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment