示例#1
0
def music():
    text = request.args['text']
    if link_or_nah(text):
      text = to_text(text) 
    else:
      text = text    

    sentiment = float(determineSubject(text))
    value = getSentValue(sentiment)
    songUrl = getSongUrlFromValue(sentiment)   
    return render_template('music.html', text=text, sentiment = sentiment, songUrl=songUrl, value=value)
示例#2
0
def music():
    text = request.args['text']
    soundtype = request.args['soundtype']
    print("soundtype: " + request.args['soundtype'])
    # if text is a link call mains
    if link_or_nah(text):
      text = to_text(text) 
    else:
      text = text    

    sentiment = float(determineSubject(text))
    value = getSentValue(sentiment)
    songUrl = getSongUrlFromValue(sentiment)   
    return render_template('music.html', text=text, sentiment = sentiment, songUrl=songUrl, value=value, soundtype=soundtype)