Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        // 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));
        }
Exemplo n.º 3
0
        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");
        }
Exemplo n.º 4
0
        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));
        }