public static string Feminine(string x) { if (irregular_feminine.TryGetValue(x, out string ret)) { return(ret); } if (elided_adj_nouns.TryGetValue(x, out KeyValuePair <string, string> test)) { return(test.Key + Noun.Feminine(test.Value)); } return(x); }
// XXX incomplete implementation; have a grammar text available but past a certain point you need a Noun or Verb class. // some languages also have the notion of dual # so this isn't even a correct API public static string Plural(this string name, bool plural) { if (!plural) { return(name); } KeyValuePair <string, string>?test = name.SplitLastWord(); if (null != test) { return(test.Value.Key + " " + Noun.Plural(test.Value.Value)); } return(Noun.Plural(name)); }
public static string Plural(string x) { if (irregular_plural.TryGetValue(x, out string ret)) { return(ret); } if (elided_adj_nouns.TryGetValue(x, out KeyValuePair <string, string> test)) { return(test.Key + Noun.Plural(test.Value)); } return(x + "s"); }
public static string Feminine(this string name) { KeyValuePair <string, string>?test = name.SplitLastWord(); if (null != test) { if ("male" == test.Value.Key.ToLowerInvariant()) { return("female " + test.Value.Value); } return(test.Value.Key + " " + Noun.Feminine(test.Value.Value)); } return(Noun.Feminine(name)); }