ó
    ôMóiè  ã                  ó¦   • S SK Jr  S SKrS SKrS SKJrJrJr  S SKJ	r	  S SK
Jr  S SKJrJr  S SKJr  S SKJr       S
             SS	 jjrg)é    )ÚannotationsN)ÚIOÚAnyÚOptional)ÚElement)ÚFileType)Úconvert_office_docÚexactly_one)Úget_last_modified_date)Úpartition_docxc           	     ór  • [        XS9  U (       a  [        U 5      OSnU b3  [        R                  R	                  U 5      (       d  [        SU  S35      e[        R                  " 5        nUb  U S3OU nUc   eUb4  [        US5       n	U	R                  UR                  5       5        SSS5        [        UUSUS9  [        R                  R                  [        R                  R                  U5      5      u  p«[        R                  R                  U5      u  pÊ[        R                  R                  X| S	35      n[!        SUU=(       d    U ["        R$                  U=(       d    US
.UD6nSSS5        U(       a  W H  nX/R&                  l        M     W$ ! , (       d  f       Nõ= f! , (       d  f       NA= f)a¤  Partitions Microsoft Word Documents in .doc format into its document elements.

All parameters available on `partition_docx()` are also available here.

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.
libre_office_filter
    The filter to use when coverting to .doc. The default is the
    filter that is required when using LibreOffice7. Pass in None
    if you do not want to apply any filter.
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.
starting_page_number
    Indicates what page number should be assigned to the first page in the document.
    This information will be reflected in elements' metadata and can be be especially
    useful when partitioning a document that is part of a larger document.
)ÚfilenameÚfileNz	The file z does not exist.z/document.docÚwbÚdocx)Útarget_formatÚtarget_filterz.docx)r   Úmetadata_filenameÚmetadata_file_typeÚmetadata_last_modified© )r
   r   ÚosÚpathÚexistsÚ
ValueErrorÚtempfileÚTemporaryDirectoryÚopenÚwriteÚreadr	   ÚsplitÚabspathÚsplitextÚjoinr   r   ÚDOCÚmetadatar   )r   r   r   r   Úlibre_office_filterÚkwargsÚlast_modifiedÚ
target_dirÚsource_file_pathÚfÚ_Úfilename_no_pathÚbase_filenameÚtarget_file_pathÚelementsÚelements                   Út/var/www/eduai.edurigo.com/storigo/production/storigo_env/lib/python3.13/site-packages/unstructured/partition/doc.pyÚpartition_docr4      s…  € ôH ˜Ò-æ8@Ô*¨8Ô4Àd€Mð Ñ¤B§G¡G§N¡N°8×$<Ñ$<Ü˜9 X JÐ.>Ð?Ó@Ð@ô 
×	$Ò	$Ô	&¨*Ø;?Ñ;K˜j˜\¨Ñ7ÐQYÐØÑ+Ð+Ð+ð ÑÜÐ&¨Ô-°Ø—‘˜Ÿ	™	›Ô$÷ .ô
 	ØØØ Ø-ò		
ô !Ÿg™gŸm™m¬B¯G©G¯O©OÐ<LÓ,MÓNÑˆÜŸ7™7×+Ñ+Ð,<Ó=ÑˆÜŸ7™7Ÿ<™<¨
°oÀUÐ4KÓLÐô
 "ð 
Ø%Ø/×;°8Ü'Ÿ|™|Ø#9×#J¸]ñ	
ð
 ñ
ˆ÷7 
'öJ ÛˆGØ(9×ÑÖ%ñ  ð €O÷E .Õ-ú÷ 
'Õ	&ús%   Á)F(Â FÂ(CF(Æ
F%	Æ!F(Æ(
F6)NNNNzMS Word 2007 XML)r   úOptional[str]r   zOptional[IO[bytes]]r   r5   r   r5   r'   r5   r(   r   Úreturnzlist[Element])Ú
__future__r   r   r   Útypingr   r   r   Úunstructured.documents.elementsr   Úunstructured.file_utils.modelr   Ú$unstructured.partition.common.commonr	   r
   Ú&unstructured.partition.common.metadatar   Úunstructured.partition.docxr   r4   r   ó    r3   Ú<module>r?      sƒ   ðÝ "ã 	Û ß $Ñ $å 3Ý 2ß PÝ IÝ 6ð #Ø $Ø'+Ø,0Ø);ðYØðYà
ðYð %ðYð *ð	Yð
 'ðYð ðYð öYr>   