diff options
| author | potato <mail@crazypotato.tk> | 2016-09-06 12:34:20 +0200 |
|---|---|---|
| committer | potato <mail@crazypotato.tk> | 2016-09-06 12:34:20 +0200 |
| commit | 3f4cc2146c81e12a890b8ea4c4ac5ad600f34618 (patch) | |
| tree | 4af200f88ce19e9edb8efa95804a8940b1e4ee0b /searx | |
| parent | 9d08c81f47325ceea6d6ae1bda594fc8b8ee7764 (diff) | |
[enh] return results instead of answers
Diffstat (limited to 'searx')
| -rw-r--r-- | searx/engines/dictionary.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/searx/engines/dictionary.py b/searx/engines/dictionary.py index 1849322f5..e3abaa1a4 100644 --- a/searx/engines/dictionary.py +++ b/searx/engines/dictionary.py @@ -3,7 +3,7 @@ from lxml import html from searx.engines.xpath import extract_text from searx.languages import language_codes -categories = [] +categories = ['general'] url = 'http://dictzone.com/{from_lang}-{to_lang}-dictionary/{query}' weight = 100 @@ -41,7 +41,6 @@ def request(query, params): def response(resp): results = [] - answers = [] dom = html.fromstring(resp.text) @@ -58,11 +57,9 @@ def response(resp): to_results.append(to_result.text_content()) results.append({ - 'answer': u'{0} - {1}'.format( - from_result.text_content(), - '; '.join(to_results) - ), - 'url': url + 'url': resp.url, + 'title': from_result.text_content(), + 'content': '; '.join(to_results) }) return results |