
    Ng                        U d dl mZ d dlmZmZmZ d dlmZ d dlm	Z	 d dl
mZ d dlmZ d dlmZ d dlmZ d	Zd
ed<   	 dddddddZdS )    )annotations)IOAnyOptional)Element)&convert_file_to_html_text_using_pandoc)FileType)exactly_one)get_last_modified_date)partition_htmlrtfstrDETECTION_ORIGINN)filemetadata_filenamemetadata_last_modifiedfilenameOptional[str]r   Optional[IO[bytes]]r   r   kwargsr   returnlist[Element]c          
         t          | |           | rt          |           nd}t          d| |          }t          d|d|p| t          j        |p|t          d|S )aq  Partitions an RTF document. The document is first converted to HTML and then
    partitioned using partition_html.

    Parameters
    ----------
    filename
        A string defining the target filename path.
    file
        A file-like object using "rb" mode --> open(filename, "rb").
    metadata_last_modified
        The last modified date for the document.
    )r   r   Nr   )source_formatr   r   unicode)textencodingr   metadata_file_typer   detection_origin )r
   r   r   r   r	   RTFr   )r   r   r   r   r   last_modified	html_texts          V/var/www/html/ai-engine/env/lib/python3.11/site-packages/unstructured/partition/rtf.pypartition_rtfr%      s    ( ----8@J*8444dM6hT  I  +7x#<5F)        )N)r   r   r   r   r   r   r   r   r   r   r   r   )
__future__r   typingr   r   r   unstructured.documents.elementsr   'unstructured.file_utils.file_conversionr   unstructured.file_utils.modelr	   $unstructured.partition.common.commonr
   &unstructured.partition.common.metadatar   unstructured.partition.htmlr   r   __annotations__r%   r    r&   r$   <module>r0      s    " " " " " " " $ $ $ $ $ $ $ $ $ $ 3 3 3 3 3 3 Z Z Z Z Z Z 2 2 2 2 2 2 < < < < < < I I I I I I 6 6 6 6 6 6      #$ !%'+,0$ $ $ $ $ $ $ $r&   