Пример #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
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
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
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