def test_phrase_text_for_head(): text = "A small collection of words" analysis = main.analyze_syntax(text) tokens = analysis.get('tokens', []) assert "words" == main.phrase_text_for_head(tokens, text, 4)