Beispiel #1
0
def search(request):
    phrase = request.GET.get('s', None)
    if phrase:
        adj = list()
        context = dict()
        ent_type = request.GET.get('t')
        ent_analyzer = WikiWrapper.search(phrase, int(ent_type))
        for res in ent_analyzer.pos_normalized['adjectives']:
            adj.append(res[0])
        context['adjectives'] = adj
        return render(request, 'search_form.tpl', context=context)
    else:
        return render(request, 'search_form.tpl')
Beispiel #2
0
 def test_gender(self):
     mitt = WikiWrapper.search('Mitt Romney', 1)
     assert mitt.gender == constants.GENDER[0]
Beispiel #3
0
 def test_gender(self):
     mitt = WikiWrapper.search('Mitt Romney', 1)
     assert mitt.gender == constants.GENDER[0]