
    ,h<                     h    d Z ddlZddlZddlZddlZddlmZ ddddddd	d
ZdZdZ	dZ
dedfdZd Zy)zA
Route the request to the appropriate parser based on file type.
    N   )
exceptionsz.jpgz.tiffz.htmlz.txtz.tsv)z.jpegz.tffz.tifz.htm z.logz.tabutf_8_parserc                    t         j                  j                  |       st        j                  |       |r)|}|j                  d      sd|z   }|j                         }n2t         j                  j                  |       \  }}|j                         }t        j                  ||      }|t        z   }	 t        j                  |d      }|j                         }	 |	j                   | ||fi |S # t        $ r t        j                  |      w xY w)zThis is the core function used for extracting text. It routes the
    ``filename`` to the appropriate parser and returns the extracted
    text as a byte-string encoded with ``encoding``.
    .ztextract.parsers)ospathexistsr   MissingFileError
startswithlowersplitextEXTENSION_SYNONYMSget_FILENAME_SUFFIX	importlibimport_moduleImportErrorExtensionNotSupportedParserprocess)
filenameinput_encodingoutput_encoding	extensionkwargsext_
rel_modulefiletype_moduleparsers
             [/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/textract/parsers/__init__.pyr   r   !   s     77>>(#))(33 ~~c")Ciik!!(+3iik 
 
 c
*C
 ''J4#11*
 ##%F6>>(NONvNN  4..s334s   2C- -Dc                     g } t         j                  j                  t         j                  j                  t                    }t         j                  j                  |dt
        z   dz         }|j                  dd      }t        j                  |j                  dd            }t        j                  |      D ]K  }|j                  |      }|j                         d   }| j                  |       | j                  d|z          M t        j                         D ]8  }|s| j                  |       | j                  |j                  ddd	             : | j                          | S )
zkGet a list of available file extensions to make it easy for
    tab-completion and exception handling.
    *z.pyz//z////z(?P<ext>\w+)r   r	   r      )r
   r   joindirname__file__r   replacerecompileglobmatchgroupsappendr   keyssort)
extensionsparsers_dirglob_filenameext_rer   	ext_matchr   s          r$   _get_available_extensionsr9   R   s'    J '',,rwwx89KGGLLc4D.Du.LMM!))$7MZZ--c?CDFIIm, %LL*	 ###)$	% "&&( 7c"ckk#r1567 OO    )__doc__r
   r   r.   r,   r   r   r   DEFAULT_OUTPUT_ENCODINGDEFAULT_ENCODINGr   r   r9    r:   r$   <module>r?      sg    
   	    "     &*;R^b .Obr:   