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})
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
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
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