public void Add(CorrectionPostModel model)
        {
            CorrectionForms singular = new CorrectionForms()
            {
                Nominative    = model.И,
                Accusative    = model.В,
                Dative        = model.Д,
                Genitive      = model.,
                Instrumental  = model.Т,
                Locative      = model.М,
                Prepositional = model.П
            };
            CorrectionForms plural = new CorrectionForms()
            {
                Nominative    = model.М_И,
                Accusative    = model.М_В,
                Dative        = model.М_Д,
                Genitive      = model.М_Р,
                Instrumental  = model.М_Т,
                Locative      = model.М_М,
                Prepositional = model.М_П
            };

            try
            {
                _client.UserDict.AddOrUpdate(new CorrectionEntry()
                {
                    Singular = singular, Plural = plural
                });
            }
            catch (Exception exc)
            {
                throw MorpherHelper.MapClientExceptionIfPossible(exc);
            }
        }
        public void Add(CorrectionPostModel model)
        {
            CorrectionForms singular = new CorrectionForms()
            {
                Nominative    = model.Н,
                Accusative    = model.З,
                Dative        = model.Д,
                Genitive      = model.,
                Instrumental  = model.О,
                Vocative      = model.К,
                Prepositional = model.М
            };

            try
            {
                _client.UserDict.AddOrUpdate(new CorrectionEntry()
                {
                    Singular = singular
                });
            }
            catch (Exception exc)
            {
                throw MorpherHelper.MapClientExceptionIfPossible(exc);
            }
        }
Beispiel #3
0
 public string Accentizer(string text)
 {
     try
     {
         return(_client.AddStressMarks(text));
     }
     catch (Exception exc)
     {
         throw MorpherHelper.MapClientExceptionIfPossible(exc);
     }
 }
Beispiel #4
0
 public List <string> Adjectives(string s)
 {
     try
     {
         return(_client.Adjectivize(s));
     }
     catch (Exception exc)
     {
         throw MorpherHelper.MapClientExceptionIfPossible(exc);
     }
 }
 public Data.DeclensionResult Declension(string s, DeclensionFlags?flags = null)
 {
     try
     {
         return(new Data.DeclensionResult(_client.Parse(s)));
     }
     catch (Exception exc)
     {
         throw MorpherHelper.MapClientExceptionIfPossible(exc);
     }
 }
 public List <Entry> GetAll()
 {
     try
     {
         return(_client.UserDict.GetAll().Select(entry => new Entry(entry)).ToList());
     }
     catch (Exception exc)
     {
         throw MorpherHelper.MapClientExceptionIfPossible(exc);
     }
 }
 public bool Remove(string nominativeForm)
 {
     try
     {
         return(_client.UserDict.Remove(nominativeForm));
     }
     catch (Exception exc)
     {
         throw MorpherHelper.MapClientExceptionIfPossible(exc);
     }
 }
Beispiel #8
0
 public Data.AdjectiveGenders AdjectiveGenders(string s)
 {
     try
     {
         var result = _client.AdjectiveGenders(s);
         return(new Data.AdjectiveGenders(result));
     }
     catch (Exception exc)
     {
         throw MorpherHelper.MapClientExceptionIfPossible(exc);
     }
 }
 public NumberSpelling Spell(decimal n, string unit)
 {
     try
     {
         var result = _client.Spell(n, unit);
         return(new NumberSpelling(
                    new Data.DeclensionForms(result.NumberDeclension),
                    new Data.DeclensionForms(result.UnitDeclension)));
     }
     catch (Exception exc)
     {
         throw MorpherHelper.MapClientExceptionIfPossible(exc);
     }
 }