internal static bool TryGetMatchedSuffixForWord( string word, IEnumerable <string> suffixes, CultureInfo culture, out string matchedSuffix) { matchedSuffix = (string)null; if (!PluralizationServiceUtil.DoesWordContainSuffix(word, suffixes, culture)) { return(false); } matchedSuffix = suffixes.First <string>((Func <string, bool>)(s => word.EndsWith(s, true, culture))); return(true); }
internal static bool TryInflectOnSuffixInWord( string word, IEnumerable <string> suffixes, Func <string, string> operationOnWord, CultureInfo culture, out string newWord) { newWord = (string)null; string matchedSuffix; if (!PluralizationServiceUtil.TryGetMatchedSuffixForWord(word, suffixes, culture, out matchedSuffix)) { return(false); } newWord = operationOnWord(word); return(true); }