コード例 #1
0
        public string LoadDecrip(string word)
        {
            string des = "";

            if ((des = sql.Decription(word)) != "")
            {
                return(des);
            }
            //Khi mạng mạnh sẽ tiếp tục
            try
            {
                des += "WORD: " + word + "\n";
                string h = wa.getSource("https://dictionary.cambridge.org/vi/dictionary/english-vietnamese/" + word);
                if (h.IndexOf("lp-m_l-25") != -1)
                {
                    return("");
                }
                h = h.Substring(h.IndexOf("ti tb") + 7);
                string type = h.Substring(0, h.IndexOf("<"));
                des += "Classifier: " + type + "\n";
                h    = h.Substring(h.IndexOf("ipa dipa") + 10);
                string pro = h.Substring(0, h.IndexOf("<"));
                des += "Pronuciation: " + pro + "\n";
                int ki;
                if ((ki = h.IndexOf("trans dtrans")) != -1)
                {
                    h = h.Substring(ki);
                    h = h.Substring(h.IndexOf(">") + 1);
                    string VI = h.Substring(0, h.IndexOf("<"));
                    des += "Means: " + VI + "\n";
                }
                h = h.Substring(h.IndexOf("eg deg") + 8);
                string etc = h.Substring(0, h.IndexOf("</div>"));
                while (etc.IndexOf("<") != -1)
                {
                    string k = etc.Substring(etc.IndexOf("<"), etc.IndexOf(">") - etc.IndexOf("<") + 1);
                    etc = etc.Replace(k, "");
                }
                des += "Example: " + etc + "\n";
            }
            catch (Exception ex)
            {
            }
            return(des);
        }
コード例 #2
0
        public string Decription(string word)
        {
            string res = sql.Decription(word);

            return(res);
        }