/// <summary> /// ''' Get the gerund value of a verb. /// ''' </summary> /// ''' <param name="str">present tense verb to make gerund.</param> /// ''' <returns>String value of the gerund form of a verb.</returns> /// ''' <remarks></remarks> public static string getGerund(string str) { // str = str.ToLower if (str.ToLower().Substring(str.Length - 1, 1) == "e") { str = str.Substring(0, str.Length - 1); } else if (str.Length > 2) { string e1, e2; // get last letter e1 = str.ToLower().Substring(str.Length - 1, 1); // get second to last letter e2 = str.ToLower().Substring(str.Length - 2, 1); // if last letter is a consonant and the second to last is a vowel if (Vowels.Contains(e2) && Consonants.Contains(e1)) { // double last letter str += e1; } } return(str + "ing"); }
public static bool IsConsonant(Symbol symbol) { return(symbol.Value != null && symbol.Length == 1 && Consonants.Contains(char.ToUpper(symbol.Value[0]))); }