Пример #1
0
        public static string ToStringMorphPerson(MorphPerson person)
        {
            StringBuilder res = new StringBuilder();

            if (((person & MorphPerson.First)) != MorphPerson.Undefined)
            {
                res.Append("1лицо|");
            }
            if (((person & MorphPerson.Second)) != MorphPerson.Undefined)
            {
                res.Append("2лицо|");
            }
            if (((person & MorphPerson.Third)) != MorphPerson.Undefined)
            {
                res.Append("3лицо|");
            }
            if (res.Length > 0)
            {
                res.Length--;
            }
            return(res.ToString());
        }
Пример #2
0
 internal bool HasMorphEquals(List <MorphWordForm> list)
 {
     foreach (MorphWordForm mr in list)
     {
         if ((Class == mr.Class && Number == mr.Number && Gender == mr.Gender) && NormalCase == mr.NormalCase && NormalFull == mr.NormalFull)
         {
             mr.Case |= Case;
             MorphPerson p = Misc.Person;
             if (p != MorphPerson.Undefined && p != mr.Misc.Person)
             {
                 MorphMiscInfo mi = new MorphMiscInfo();
                 mi.CopyFrom(mr.Misc);
                 mi.Person = mr.Misc.Person | Misc.Person;
                 mr.Misc   = mi;
             }
             return(true);
         }
     }
     foreach (MorphWordForm mr in list)
     {
         if ((Class == mr.Class && Number == mr.Number && Case == mr.Case) && NormalCase == mr.NormalCase && NormalFull == mr.NormalFull)
         {
             mr.Gender |= Gender;
             return(true);
         }
     }
     foreach (MorphWordForm mr in list)
     {
         if ((Class == mr.Class && Gender == mr.Gender && Case == mr.Case) && NormalCase == mr.NormalCase && NormalFull == mr.NormalFull)
         {
             mr.Number |= Number;
             return(true);
         }
     }
     return(false);
 }