#NEWLINE# @ classmethod #NEWLINE# def create_with_entity( cls , kind , document , offset , offset_end ) : #NEWLINE# #INDENT# ( entity , _ ) = Entity . objects . get_or_create ( key = '{} {} {} {}' . format ( kind . human_identifier , kind , offset , offset_end ) , kind = kind ) #NEWLINE# entity_occurrence = EntityOccurrence ( entity = entity , document = document , offset = offset , offset_end = offset_end , alias = ' ' . join ( document . tokens [ offset : offset_end ] ) ) #NEWLINE# entity_occurrence . save ( ) #NEWLINE# segmenter_runner = segmenter . SyntacticSegmenterRunner ( override = True ) #NEWLINE# segmenter_runner ( document )