
    j	                        U d dl mZmZmZ d dlmZ d dlmZmZ d dl	m
Z
mZ d dlmZ d dlmZ dZeed<    e             ee
j                   e            d	d	d
dd	d	d	dgd
f	dee         deee                  dededee         dee         dee         deee                  dedee         fd                                    Zd	S )    )IOListOptional)add_chunking_strategy)Elementprocess_metadata)FileTypeadd_metadata_with_filetype)convert_and_partition_html)apply_lang_metadataepubDETECTION_ORIGINNFTautofilenamefileinclude_page_breaksinclude_metadatametadata_filenamemetadata_last_modifiedchunking_strategy	languagesdetect_language_per_elementreturnc	           	      z    t          | ||||dt                    }
t          t          |
||                    }
|
S )a[  Partitions an EPUB 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").
    include_page_breaks
        If True, the output will include page breaks if the filetype supports it
    metadata_last_modified
        The last modified date for the document.
    languages
        User defined value for `metadata.languages` if provided. Otherwise language is detected
        using naive Bayesian filter via `langdetect`. Multiple languages indicates text could be
        in either language.
        Additional Parameters:
            detect_language_per_element
                Detect language per element instead of at the document level.
    r   )r   r   r   r   r   source_formatdetection_origin)r   r   )r   r   listr   )r   r   r   r   r   r   r   r   r   kwargselementss              e/lsinfo/ai/hellotax_ai/base_platform/venv/lib/python3.11/site-packages/unstructured/partition/epub.pypartition_epubr!      sa    J */+5)  H (C	
 	
 	
 H O    )typingr   r   r   unstructured.chunkingr   unstructured.documents.elementsr   r    unstructured.file_utils.filetyper	   r
   unstructured.partition.htmlr   unstructured.partition.langr   r   str__annotations__EPUBbytesboolr!    r"   r    <module>r/      s   % % % % % % % % % % % 7 7 7 7 7 7 E E E E E E E E Q Q Q Q Q Q Q Q B B B B B B ; ; ; ; ; ; #    HM**" $ %!'+,0'+&,X(-4 4sm4
2e9
4 4 	4
  }4 %SM4  }4 S	"4 "&4 
']4 4 4  +* 4 4 4r"   