
    ,h                     6    d dl Z d dlZddlmZ  G d de      Zy)    N   )
BaseParserc                       e Zd ZdZd Zd Zy)ParserzExtract all of the string values of a json file (no keys as those
    are, in some sense, markup). This is useful for parsing content
    from mongodb dumps, for example.
    c                     t        |d      5 }t        j                  |      }d d d        | j                        S # 1 sw Y   xY w)Nr)openjsonloadget_text)selffilenamekwargsrawdeserialized_jsons        ^/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/textract/parsers/json_parser.pyextractzParser.extract   sA    (C  	/C $		#	/}}.//	/ 	/s	   <Ac                    t        |t              r.d}t        |      D ]  }|| j                  ||         dz   z  } |S t        |t              r"d}|D ]  }|| j                  |      dz   z  } |S t        |t
        j                        r|S y)zRecursively get text from subcomponents of a deserialized json. To
        enforce the same order on the documents, make sure to read keys of
        deserialized_json in a consistent (alphabetical) order.
          )
isinstancedictsortedr   listsixstring_types)r   r   resultkeyitems        r   r   zParser.get_text   s    
 '.F/0 F$--(9#(>?#EEFM'.F) 4$---334M')9)9:$$    N)__name__
__module____qualname____doc__r   r    r    r   r   r      s    
0
r    r   )r
   r   utilsr   r   r%   r    r   <module>r'      s     
 Z r    