Пример #1
0
        internal void GenerateStem()
        {
            if (IsException1())
            {
                return;
            }
            //If the word has two letters or less, leave it as it is.
            if (Stem.Length < 3)
            {
                return;
            }

            //Remove initial ', if present. +
            StandardiseApostrophesAndStripLeading();

            //Set initial y, or y after a vowel, to Y
            MarkYs();

            //establish the regions R1 and R2. (See note on vowel marking.)
            if (Stem.StartsWith("gener") ||
                Stem.StartsWith("arsen"))
            {
                _r1 = CalculateR(Stem, 2);
            }
            else if (Stem.StartsWith("commun"))
            {
                _r1 = CalculateR(Stem, 3);
            }
            else
            {
                _r1 = CalculateR(Stem, 0);
            }
            _r2 = CalculateR(Stem, _r1.Start);

            //Step0
            StripTrailingApostrophe();
            //Step1a
            StripSuffixStep1a();

            if (IsException2())
            {
                return;
            }

            //Step1b
            StripSuffixStep1b();
            //Step 1c: *
            ReplaceSuffixStep1c();
            //Step2
            ReplaceEndingStep2();
            //Step3
            ReplaceEndingStep3();
            //Step4
            StripSuffixStep4();
            //Step5
            StripSuffixStep5();
            //Finally, turn any remaining Y letters in the word back into lower case.
            Finally();
        }