Example #1
0
def get_word_freq_in_chunk():
    word_list= json.loads(request.data)
    s= db.get_text_by_title(session['text_id'])
    freq_list={};
    for w in word_list:
        freq_list[w]=wrappers.get_chunked_word_frequency(s,w, 50) 
    return jsonify(freq_list)
Example #2
0
def get_word_count():
    txt = db.get_text_by_title(session['text_id'])
    d = wrappers.get_freq_dist_dict(txt)
    return jsonify(d)
Example #3
0
def get_idx():
    """Sets text in session, returns body of text"""
    session['text_id'] = request.data
    text = db.get_text_by_title(session['text_id'])
    return jsonify({"textbody":text})