Exemplo n.º 1
0
def charts():
    translate = Translate()
    words_to_translate = request.args['words']
    count_words = translate.count_words(words_to_translate)
    words = translate.sort_words(count_words)
    visual = Visual(dict_words=words, file_name="line")

    return render_template('chart.html',
                           title='Analysis',
                           chart=visual.mkPie())
Exemplo n.º 2
0
def translate_words():
    translate_server = getenv("TRANSLATE_SRV", "http://127.0.0.1:8080")
    translate = Translate(translate_server)
    words_to_translate = request.args['words']
    count_words = translate.count_words(words_to_translate)
    translate_words = translate.translate_words(count_words)
    words = translate.sort_words(translate_words)

    return render_template('translate_words.html',
                           title='Translated words',
                           words=words)