@pytest.mark.models
def test_unit_end_gazetteer(EN):
 matcher = Matcher(EN.vocab, {u'MemberNames': (u'PERSON', {}, [[{LOWER: u'cal'}], [{LOWER: u'cal'}, {LOWER: u'henderson'}]])})
 doc = EN(u'who is cal the manager of?')
 if (len(list(doc.ents)) == 0):
  ents = matcher(doc)
  assert (len(ents) == 1)
  doc.ents += tuple(ents)
  EN.entity(doc)
  assert (list(doc.ents)[0].text == u'cal')

@ pytest . mark . models def test_unit_end_gazetteer ( EN ) : matcher = Matcher ( EN . vocab , { u'MemberNames' : ( u'PERSON' , { } , [ [ { LOWER : u'cal' } ] , [ { LOWER : u'cal' } , { LOWER : u'henderson' } ] ] ) } ) doc = EN ( u'who is cal the manager of?' ) if ( len ( list ( doc . ents ) ) == 0 ) : ents = matcher ( doc ) assert ( len ( ents ) == 1 ) doc . ents += tuple ( ents ) EN . entity ( doc ) assert ( list ( doc . ents ) [ 0 ] . text == u'cal' )
test a bug in the interaction between the ner model and the gazetteer .