def limit_sentences (path, word_limit=<NUM_LIT:100>):
word_count = <NUM_LIT:0><EOL>if isinstance(path, str):<EOL><INDENT>path = json_iter(path)<EOL><DEDENT>for meta in path:<EOL><INDENT>if not isinstance(meta, SummarySent):<EOL><INDENT>p = SummarySent(**meta)<EOL><DEDENT>else:<EOL><INDENT>p = meta<EOL><DEDENT>sent_text = p.text.strip().split("<STR_LIT:U+0020>")<EOL>sent_len = len(sent_text)<EOL>if (word_count + sent_len) > word_limit:<EOL><INDENT>break<EOL><DEDENT>else:<EOL><INDENT>word_count += sent_len<EOL>yield sent_text, p.idx<EOL><DEDENT><DEDENT>
iterator for the most significant sentences, up to a specified limit