Exemplo n.º 1
0
        public void TestMethod1()
        {
            BaseSynonymService service = new ThesaurusSynonymService(new SettingElements(), new PluginInitContext());

            var url = String.Format("?word={0}&language={1}&key={2}&output=json", "te", "fr_FR", string.Empty);
            var response = service.GetResponse(url);
            var result = service.TransformResponseToResults(response);

            
        }
Exemplo n.º 2
0
        public List<Result> Query(Query query)
        {
            if (query == null)
                throw new ArgumentNullException("query", "query is null.");

            if (query.ActionParameters.Count < 1)
                return ShowUsage(query);

            _context.API.StartLoadingBar();

            BaseSynonymService service;
            service = new ThesaurusSynonymService(_settings, _context);

            try
            {
                string queryString = service.GetQueryString(query.GetAllRemainingParameter());
                var response = service.GetResponse(queryString);
                return service.TransformResponseToResults(response);
            }
            finally
            {
                _context.API.StopLoadingBar();
            }
        }