Pomona.SingularToPluralTranslator.ToPluralNoIrregular C# (CSharp) Method

ToPluralNoIrregular() public static method

public static ToPluralNoIrregular ( string noun ) : string
noun string
return string
        public static string ToPluralNoIrregular(string noun)
        {
            // check if word ends in sibilant sound
            if (sibilantEndings.Any(x => noun.EndsWith(x)))
                return noun + "es";

            if (noun.EndsWith("y"))
                return noun.Substring(0, noun.Length - 1) + "ies";

            if (noun.EndsWith("f"))
                return noun.Substring(0, noun.Length - 1) + "ves";

            if (noun.EndsWith("fe"))
                return noun.Substring(0, noun.Length - 2) + "ves";

            return noun + "s";
        }