Example #1
0
        public void CopyFrom(MorphBaseInfo src)
        {
            MorphClass cla = new MorphClass();

            cla.Value = src.Class.Value;
            Class     = cla;
            Gender    = src.Gender;
            Number    = src.Number;
            MorphCase cas = new MorphCase();

            cas.Value = src.Case.Value;
            Case      = cas;
            MorphLang lng = new MorphLang();

            lng.Value = src.Language.Value;
            Language  = lng;
        }
Example #2
0
        /// <summary>
        /// Восстановить падежи из строки, полученной ToString
        /// </summary>
        public static MorphCase Parse(string str)
        {
            MorphCase res = new MorphCase();

            if (string.IsNullOrEmpty(str))
            {
                return(res);
            }
            foreach (string s in str.Split('|'))
            {
                for (int i = 0; i < m_Names.Length; i++)
                {
                    if (s == m_Names[i])
                    {
                        res.SetValue(i, true);
                        break;
                    }
                }
            }
            return(res);
        }