コード例 #1
0
        public WebTranslator()
        {
            GoogleWebRead     = new WebApi.WebReader(@"translate.google.com");
            MultillectWebRead = new WebApi.WebReader(@"translate.multillect.com");
            YandexWebRead     = new WebApi.WebReader(@"translate.yandex.net");

            Task.Run(() =>
            {
                try
                {
                    amazonTranslateClient = new Amazon.Translate.AmazonTranslateClient(@"", @"", Amazon.RegionEndpoint.EUCentral1);
                    amazonLoaded          = true;
                }
                catch (Exception ex)
                { Logger.WriteLog(Convert.ToString(ex)); }
            });

            _DeepLTranslator = new DeepLTranslator();

            _TranslatorsLanguages = new List <ReadOnlyCollection <TranslatorLanguague> >();

            string pattern = "(?<=(<div dir=\"ltr\" class=\"t0\">)).*?(?=(<\\/div>))";

            GoogleRx = new Regex(pattern, RegexOptions.Compiled | RegexOptions.IgnoreCase);
        }
コード例 #2
0
        public WebTranslator()
        {
            GoogleWebRead = new WebApi.WebReader(@"translate.google.com");
            MultillectWebRead = new WebApi.WebReader(@"translate.multillect.com");
            YandexWebRead = new WebApi.WebReader(@"translate.yandex.net");

            _DeepLTranslator = new DeepLTranslator();

            _TranslatorsLanguages = new List<ReadOnlyCollection<TranslatorLanguague>>();

            string pattern = "(?<=(<div dir=\"ltr\" class=\"t0\">)).*?(?=(<\\/div>))";

            GoogleRx = new Regex(pattern, RegexOptions.Compiled | RegexOptions.IgnoreCase);
        }