def docx_docx_gen_text(doc: DOCX_DOCUMENT_TYPE,
                       config: TextProcessingConfig) -> Iterator[str]:
    # only called if docx loaded
    """
    Iterate through a DOCX file and yield text.

    Args:
        doc: DOCX document to process
        config: :class:`TextProcessingConfig` control object

    Yields:
        pieces of text (paragraphs)

    """
    if in_order:
        for thing in docx_docx_iter_block_items(doc):
            if isinstance(thing, docx.text.paragraph.Paragraph):
                yield docx_process_simple_text(thing.text, config.width)
            elif isinstance(thing, docx.table.Table):
                yield docx_process_table(thing, config)
    else:
        for paragraph in doc.paragraphs:
            yield docx_process_simple_text(paragraph.text, config.width)
        for table in doc.tables:
            yield docx_process_table(table, config)
def docx_docx_gen_text ( doc : DOCX_DOCUMENT_TYPE , config : TextProcessingConfig ) -> Iterator [ str ] : if in_order : for thing in docx_docx_iter_block_items ( doc ) : if isinstance ( thing , docx . text . paragraph . Paragraph ) : yield docx_process_simple_text ( thing . text , config . width ) elif isinstance ( thing , docx . table . Table ) : yield docx_process_table ( thing , config ) else : for paragraph in doc . paragraphs : yield docx_process_simple_text ( paragraph . text , config . width ) for table in doc . tables : yield docx_process_table ( table , config )
Iterate through a DOCX file and yield text.

    Args:
        doc: DOCX document to process
        config: :class:`TextProcessingConfig` control object

    Yields:
        pieces of text (paragraphs)