예제 #1
0
 private void RecognizeAdverbs(GrammarCode code)
 {
     if (code.GrammarCodeVariant1.StartsWith("ADV"))
     {
         code.PartOfSpeech      = PartOfSpeechType.ADVerb;
         code.CaseOfDeclination = CaseOfDeclinationType.Accusative;
         var codeText = code.GrammarCodeVariant1;
         if (codeText.Length == 5)
         {
             var form = codeText.Substring(4).GetEnumByCategory <FormType>();
             if (form != FormType.None)
             {
                 code.Form = form;
             }
             else
             {
                 var degree = codeText[4].ToString().GetEnumByCategory <AdjectiveDegreeType>();
                 if (degree != AdjectiveDegreeType.None)
                 {
                     code.AdjectiveDegree = degree;
                 }
             }
         }
         code.Save();
     }
 }
예제 #2
0
        private void RecognizeReciprocalPronoun(GrammarCode code)
        {
            code.PartOfSpeech = PartOfSpeechType.reCiprocal_pronoun;

            var codeText = code.GrammarCodeVariant1;

            if (codeText.Length > 3)
            {
                var caseOfDeclination = codeText[2].ToString().GetEnumByCategory <CaseOfDeclinationType>();
                if (caseOfDeclination != CaseOfDeclinationType.None)
                {
                    code.CaseOfDeclination = caseOfDeclination;
                }

                var number = codeText[3].ToString().GetEnumByCategory <NumberType>();
                if (number != NumberType.None)
                {
                    code.Number = number;
                }
            }

            if (codeText.Length > 4)
            {
                var gender = codeText[4].ToString().GetEnumByCategory <GenderType>();
                if (gender != GenderType.None)
                {
                    code.Gender = gender;
                }
            }

            code.Save();
        }
예제 #3
0
        private void RecognizeAdjectives(GrammarCode code)
        {
            if (code.GrammarCodeVariant1.StartsWith("A-"))
            {
                code.PartOfSpeech = PartOfSpeechType.Adjective;

                var codeText = code.GrammarCodeVariant1;
                if (codeText.StartsWith("A-NU"))
                {
                    code.PartOfSpeech = PartOfSpeechType.Indeclinable_NUmeral;
                    code.Number       = NumberType.Plural;
                }

                if (codeText.Length > 3)
                {
                    var caseOfDeclination = codeText[2].ToString().GetEnumByCategory <CaseOfDeclinationType>();
                    if (caseOfDeclination != CaseOfDeclinationType.None)
                    {
                        code.CaseOfDeclination = caseOfDeclination;
                    }

                    var number = codeText[3].ToString().GetEnumByCategory <NumberType>();
                    if (number != NumberType.None)
                    {
                        code.Number = number;
                    }
                }

                if (codeText.Length > 4)
                {
                    var gender = codeText[4].ToString().GetEnumByCategory <GenderType>();
                    if (gender != GenderType.None)
                    {
                        code.Gender = gender;
                    }
                }

                if (codeText.Length == 7)
                {
                    var degree = codeText[6].ToString().GetEnumByCategory <AdjectiveDegreeType>();
                    if (degree != AdjectiveDegreeType.None)
                    {
                        code.AdjectiveDegree = degree;
                    }
                }
                else if (codeText.Length == 6)
                {
                    var degree = codeText[5].ToString().GetEnumByCategory <AdjectiveDegreeType>();
                    if (degree != AdjectiveDegreeType.None)
                    {
                        code.AdjectiveDegree = degree;
                    }
                }
                else if (codeText.Length == 9)
                {
                    var form = codeText.Substring(6).GetEnumByCategory <FormType>();
                    if (form != FormType.None)
                    {
                        code.Form = form;
                    }
                }

                code.Save();
            }
        }
예제 #4
0
 private void RecognizeAram(GrammarCode code)
 {
     code.PartOfSpeech = PartOfSpeechType.ARAM;
     code.Save();
 }