32 result = loads(resp.text)
34 from_to_prefix =
"%s-%s " % (resp.search_params[
'from_lang'][1], resp.search_params[
'to_lang'][1])
37 results.append({
"suggestion": from_to_prefix + info[
"typo"]})
39 if 'definitions' in info:
40 for definition
in info[
'definitions']:
41 if 'list' in definition:
42 for item
in definition[
'list']:
43 if 'synonyms' in item:
44 for synonym
in item[
'synonyms']:
45 results.append({
"suggestion": from_to_prefix + synonym})
49 for translation
in info[
"extraTranslations"]:
50 for word
in translation[
"list"]:
51 infobox += f
"<dl><dt>{word['word']}</dt>"
53 for meaning
in word[
"meanings"]:
54 infobox += f
"<dd>{meaning}</dd>"
60 'infobox': result[
"translation"],