def _generate(self):
doc_count = <NUM_LIT:0><EOL>for fp in self.all_files:<EOL><INDENT>for doc in self._get_docs_for_path(fp):<EOL><INDENT>yield doc<EOL>doc_count += <NUM_LIT:1><EOL>if doc_count >= self.max_docs:<EOL><INDENT>return<EOL><DEDENT><DEDENT><DEDENT>
Parses a file or directory of files into a set of ``Document`` objects.