예제 #1
0
파일: views.py 프로젝트: recsm/SQP
def get_num_sentences(request):
    """A view used to test NLP"""
    if request.method == 'POST':
        try:
            text = request.POST['original']
            num_sentences = nlp_tools.count_sentences(text)
        except:
            num_sentences = 'error'
    else:
        num_sentences = ''
    return render_to_response('sqp/get_quantity.html', {'quantity'
                              : num_sentences})
예제 #2
0
파일: suggestions.py 프로젝트: recsm/SQP
def ans_num_sentences(question, characteristic):
    "Suggestion for number of sentences in answer categories."
    return nlp_tools.count_sentences(question.answer_text, lan=question.language.iso), None
예제 #3
0
파일: suggestions.py 프로젝트: recsm/SQP
def rfa_num_sentences(question, characteristic):
    "Suggestion for number of sentences in Request for an Answer (RFA)."
    return nlp_tools.count_sentences(question.rfa_text, lan=question.language.iso), None
예제 #4
0
파일: suggestions.py 프로젝트: recsm/SQP
def int_num_sentences(question, characteristic):
    "Suggestion for number of sentences in introduction."
    return nlp_tools.count_sentences(question.introduction_text, lan=question.language.iso), None