示例#1
0
        public SingularInfoC(string lemma, Gender gender, string slenderizationTarget)
        {
            this.gender = gender;
            this.nominative.Add(new Form(lemma));
            this.dative.Add(new Form(lemma));

            //derive and assign the vocative:
            string form = lemma;

            form = Regex.Replace(form, "ch$", "gh");           //eg. bacach > bacaigh
            form = Opers.Slenderize(form, slenderizationTarget);
            if (gender == Gender.Fem)
            {
                this.vocative.Add(new Form(lemma));
            }
            else
            {
                this.vocative.Add(new Form(form));
            }

            //derive and assign the genitive:
            if (gender == Gender.Fem)
            {
                form = Regex.Replace(form, "igh$", "í");                              //eg. cailleach > cailleaí
            }
            this.genitive.Add(new Form(form));
        }
示例#2
0
        public SingularInfoE(string lemma, Gender gender, bool syncope, bool doubleDative, string slenderizationTarget)
        {
            this.gender = gender;
            this.nominative.Add(new Form(lemma));
            this.vocative.Add(new Form(lemma));

            //derive the dative:
            string form = lemma;

            if (syncope)
            {
                form = Opers.Syncope(form);
            }
            form = Opers.Slenderize(form, slenderizationTarget);
            if (!doubleDative)
            {
                this.dative.Add(new Form(lemma));
            }
            else
            {
                this.dative.Add(new Form(lemma));
                this.dative.Add(new Form(form));
            }

            //continue deriving the genitive:
            form = Regex.Replace(form, "([" + Opers.VowelsSlender + "])ngt$", "$1ngth"); //eg. tarraingt > tarraingthe
            form = Regex.Replace(form, "ú$", "ath");                                     //eg. scrúdú > scrúdaithe
            form = form + "e";
            this.genitive.Add(new Form(form));
        }
示例#3
0
        public PluralInfoLgE(string bayse, string slenderizationTarget)
        {
            this.strength = Strength.Weak;

            string form = bayse;

            form = Opers.Slenderize(form, slenderizationTarget) + "e";

            this.nominative.Add(new Form(form));
            this.genitive.Add(new Form(Opers.Broaden(bayse)));
            this.vocative.Add(new Form(form));
        }
示例#4
0
        //Performs irregular slenderization (attenuation): if the base ends in a consonant, and if the vowel cluster immediately before this consonant
        //ends in a broad vowel, then it changes this vowel cluster into the target (the second argument).
        //Note: if the target does not end in a slender vowel, then regular slenderization is attempted instead.
        //Note: a base that's already attenuated passes through unchanged.
        public static string Slenderize(string bayse, string target)
        {
            string ret = bayse;

            if (!Regex.IsMatch(target, "[" + Opers.VowelsSlender + "]$"))
            {
                ret = Opers.Slenderize(bayse);               //attempt regular slenderization instead
            }
            else
            {
                Match match = Regex.Match(bayse, "^(.*?)[" + Opers.Vowels + "]*[" + Opers.VowelsBroad + "]([" + Opers.Cosonants + "]+)$");
                if (match.Success)
                {
                    ret = match.Groups[1].Value + target + match.Groups[2].Value;
                }
            }
            return(ret);
        }
示例#5
0
        public SingularInfoEAX(string lemma, Gender gender, bool syncope, string slenderizationTarget)
        {
            this.gender = gender;
            this.nominative.Add(new Form(lemma));
            this.vocative.Add(new Form(lemma));
            this.dative.Add(new Form(lemma));

            //derive the genitive:
            string form = lemma;

            if (syncope)
            {
                form = Opers.Syncope(form);
            }
            form = Opers.Slenderize(form, slenderizationTarget);
            form = form + "each";
            this.genitive.Add(new Form(form));
        }
示例#6
0
        public PluralInfoLgC(string bayse, string slenderizationTarget)
        {
            this.strength = Strength.Weak;

            //generate the genitive:
            string form = Opers.Broaden(bayse);

            this.genitive.Add(new Form(form));

            //generate the vocative:
            form = form + "a";
            this.vocative.Add(new Form(form));

            //generate the nominative:
            form = bayse;
            form = Regex.Replace(form, "ch$", "gh");           //eg. bacach > bacaigh
            form = Opers.Slenderize(form, slenderizationTarget);
            this.nominative.Add(new Form(form));
        }