예제 #1
0
        public static string Decline(string FullName, Padeg padeg)
        {
            nc.FullReset();
            String tmp = nc.Q(FullName, padeg);

            return(tmp);
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(comboBox1.Text))
            {
                textBox1.Clear();
                textBox1.AppendText(string.Format("Версия библиотеки: {0}\r\n", Core.Version));
                if (radioButton1.Checked)
                {
                    Ru lang = new Ru();
                    textBox1.AppendText(string.Format("[Ru] Версия правил: {0}\r\n", Ru.LanguageBuild));
                    textBox1.AppendText("\r\n");

                    string[]  m  = lang.Q(comboBox1.Text);
                    WordArray wa = lang.GetWordsArray();
                    textBox1.AppendText(string.Format("Фамилия:  {0}\r\n", lang.GetSurNameCase(Padeg.IMENITLN)));
                    textBox1.AppendText(string.Format("Имя:      {0}\r\n", lang.GetNameCase(Padeg.IMENITLN)));
                    textBox1.AppendText(string.Format("Отчество: {0}\r\n", lang.GetPatrNameCase(Padeg.IMENITLN)));
                    textBox1.AppendText("\r\n");

                    textBox1.AppendText(string.Format("Пол: {0}\r\n", lang.GenderAutoDetect().GetDescription()));
                    textBox1.AppendText("\r\n");

                    textBox1.AppendText("Падежи:\r\n");
                    textBox1.AppendText(string.Format(" Именительный   (кто? что?): {0}\r\n", m[0]));
                    textBox1.AppendText(string.Format(" Родительный  (кого? чего?): {0}\r\n", m[1]));
                    textBox1.AppendText(string.Format(" Дательный    (кому? чему?): {0}\r\n", m[2]));
                    textBox1.AppendText(string.Format(" Винительный   (кого? что?): {0}\r\n", m[3]));
                    textBox1.AppendText(string.Format(" Творительный   (кем? чем?): {0}\r\n", m[4]));
                    textBox1.AppendText(string.Format(" Предложный (о ком? о чём?): {0}\r\n", m[5]));
                }
                else
                {
                    Ua lang = new Ua();
                    textBox1.AppendText(string.Format("[Ua] Версiя правил: {0}\r\n", Ua.LanguageBuild));
                    textBox1.AppendText("\r\n");

                    string[]  m  = lang.Q(comboBox1.Text);
                    WordArray wa = lang.GetWordsArray();
                    textBox1.AppendText(string.Format("Прізвище: {0}\r\n", lang.GetSurNameCase(Padeg.IMENITLN)));
                    textBox1.AppendText(string.Format("Iм'я:     {0}\r\n", lang.GetNameCase(Padeg.IMENITLN)));
                    textBox1.AppendText(string.Format("Батькові: {0}\r\n", lang.GetPatrNameCase(Padeg.IMENITLN)));
                    textBox1.AppendText("\r\n");

                    Gender gender = lang.GenderAutoDetect();
                    textBox1.AppendText(string.Format("Стать: {0}\r\n", (gender == Gender.Man) ? "Чоловіча" : "Жіноча"));
                    textBox1.AppendText("\r\n");

                    textBox1.AppendText("Відмінки:\r\n");
                    textBox1.AppendText(string.Format(" Називний : {0}\r\n", m[0]));
                    textBox1.AppendText(string.Format(" Родовий  : {0}\r\n", m[1]));
                    textBox1.AppendText(string.Format(" Давальний: {0}\r\n", m[2]));
                    textBox1.AppendText(string.Format(" Знахідний: {0}\r\n", m[3]));
                    textBox1.AppendText(string.Format(" Орудний  : {0}\r\n", m[4]));
                    textBox1.AppendText(string.Format(" Місцевий : {0}\r\n", m[5]));
                    textBox1.AppendText(string.Format(" Кличний  : {0}\r\n", m[6]));
                }
            }
        }
        public ActionResult <string> Post([FromBody] Payload value)
        {
            dynamic obj = new JObject();

            obj.version       = Core.Version;
            obj.languageBuild = Ru.LanguageBuild;
            Ru ru = new Ru();

            object[] m = ru.Q(value.FullName);
            obj.cases = new JArray(m);
            return(obj.ToString());
        }
        public ActionResult <string> Get(string s)
        {
            string res = "";

            if (!string.IsNullOrWhiteSpace(s))
            {
                dynamic obj = new JObject();
                obj.version       = Core.Version;
                obj.languageBuild = Ru.LanguageBuild;
                Ru       ru = new Ru();
                object[] m  = ru.Q(s);
                obj.cases = new JArray(m);
                res       = obj.ToString();
            }
            return(res);
        }