protected override void DoTranslate(string phrase, LanguagePair languagesPair, string subject, Result result, NetworkSetting networkSetting)
        {
            string query = "http://openthes-es.berlios.de/multimatch.php?word={0}&search=1";

            query = string.Format(CultureInfo.InvariantCulture, query,
                                  HttpUtility.UrlEncode(phrase, encoding)
                                  );

            result.ArticleUrl        = query;
            result.ArticleUrlCaption = phrase;

            WebRequestHelper helper =
                new WebRequestHelper(result, new Uri(query),
                                     networkSetting,
                                     WebRequestContentType.UrlEncodedGet, encoding);


            string responseFromServer = helper.GetResponse();

            if (responseFromServer.Contains("<li>No matches</li>"))
            {
                result.ResultNotFound = true;
                throw new TranslationException("Nothing found");
            }


            OpenthesaurusDeDictionary.SetResult(result, responseFromServer);
        }
Exemple #2
0
        protected override void DoTranslate(string phrase, LanguagePair languagesPair, string subject, Result result, NetworkSetting networkSetting)
        {
            string query = "http://193.2.66.133:85/overview.php?search=1&word={0}";

            query = string.Format(CultureInfo.InvariantCulture, query,
                                  HttpUtility.UrlEncode(phrase, encoding)
                                  );

            result.ArticleUrl        = query;
            result.ArticleUrlCaption = phrase;

            WebRequestHelper helper =
                new WebRequestHelper(result, new Uri(query),
                                     networkSetting,
                                     WebRequestContentType.UrlEncodedGet, encoding);


            string responseFromServer = helper.GetResponse();

            OpenthesaurusDeDictionary.SetResult(result, responseFromServer);
        }