def find_terms(words, max_words_per_term):
    if len(words) == 0:
        return []
max_term_len = min(len(words), max_words_per_term)
initial_terms = [' '.join(words[:i + 1]) for i in range(max_term_len)]
other_terms = find_terms(words[1:], max_words_per_term)
return initial_terms + other_terms
How do I generate multi-word terms recursively?