Пример #1
0
 /// <summary>
 /// The plural form of a one-word singular noun
 /// </summary>
 public static string PluralOfNoun(string singular)
 {
     if (IrregularPlurals.TryGetValue(singular, out string plural))
     {
         return(plural);
     }
     foreach (var i in Inflections)
     {
         if (i.MatchSingularForPlural(singular))
         {
             return(i.InflectSingularForPlural(singular));
         }
     }
     throw new ArgumentException($"'{singular}' appears to be a singular noun, but I can't find a plural inflection for it");
 }
Пример #2
0
 /// <summary>
 /// The plural form of a one-word singular noun
 /// </summary>
 public static string PluralOfNoun(string singular)
 {
     if (IrregularPlurals.TryGetValue(singular, out string plural))
     {
         return(plural);
     }
     foreach (var i in Inflections)
     {
         if (i.MatchSingularForPlural(singular))
         {
             return(i.InflectSingularForPlural(singular));
         }
     }
     throw new GrammaticalError($"'{singular}' appears to be a singular noun, but I can't find a plural inflection for it",
                                $"In this context, the term '<i>{singular}</i>' appears to be a singular noun, but I can't find a plural inflection for it");
 }