def phrase_text_for_head(tokens, text, head_index):
 (begin, end) = phrase_extent_for_head(tokens, head_index)
 return text[begin:end]

def phrase_text_for_head ( tokens , text , head_index ) : ( begin , end ) = phrase_extent_for_head ( tokens , head_index ) return text [ begin : end ]
returns the entire phrase containing the head token and its dependents .