§
    û�ÄjÈ
  ã                   ó¼   — d Z dZddlmZmZmZ ddlZddlmZ dddd	œd
œZ	dee
ee
         f         de
fd„Z	 	 dde
dee
         defd„Z	 ddee
         de
defd„ZdS )z
language detection API
z"Copyright (C) 2020 Nidhal Baccourié    )ÚListÚOptionalÚUnionN)Ú	HTTPErrorz(https://ws.detectlanguage.com/0.2/detectz'Detect Language API Python Client 1.4.0z	Bearer {})z
User-AgentÚAuthorization)ÚurlÚheadersÚtextÚapi_keyc                 óŠ  — |st          d¦  «        ‚| st          d¦  «        ‚	 t          d         }|d                              |¦  «        |d<   t          j        t          d         d| i|¬¦  «        }|                     ¦   «                              d¦  «        }|S # t          $ r}t          d	|j	        ¦  «         |‚d
}~ww xY w)zâ
    send a request and return the response body parsed as dictionary

    @param text: target text that you want to detect its language
    @type text: str
    @type api_key: str
    @param api_key: your private API key

    zlyou need to get an API_KEY for this to work. Get one for free here: https://detectlanguage.com/documentationzPlease provide an input textr	   r   r   Úq)Újsonr	   Údataz,Error occured while requesting from server: N)
Ú	ExceptionÚconfigÚformatÚrequestsÚpostr   Úgetr   ÚprintÚargs)r
   r   r   Úkwargsr	   ÚresponseÚbodyÚes           úJC:\Projects\Historical\venv\Lib\site-packages\deep_translator/detection.pyÚget_request_bodyr      sç   € ð ð 
ÝðNñ
ô 
ð 	
ð ð ÝÐ6Ñ7Ô7Ð7ð	Ý˜YÔ'ˆGØ'.¨Ô'?×'FÒ'FÀwÑ'OÔ'OˆG�OÑ$Ý”}Ý�u” S¨$ K¸ðñ ô ˆHð —=’=‘?”?×&Ò& vÑ.Ô.ˆDØˆKøåð 	ð 	ð 	ÝÐ@À!Ä&ÑIÔIÐIØˆGøøøøð	øøøs   ¤A7B Â
CÂ&B=Â=CFÚdetailedc                 ó¤   — t          | |¦  «        }|                     d¦  «        }|r|d         S |d                              dd¦  «        }|r|S dS )aE  
    function responsible for detecting the language from a text

    @param text: target text that you want to detect its language
    @type text: str
    @type api_key: str
    @param api_key: your private API key
    @param detailed: set to True if you want to get detailed
    information about the detection process
    Ú
detectionsr   ÚlanguageN©r   r   )r
   r   r   r   r   r   r    Úlangs           r   Úsingle_detectionr$   :   sf   € õ" ˜D 'Ñ*Ô*€DØ—’˜,Ñ'Ô'€JØð Ø˜!Œ}Ðà�aŒ=×Ò˜Z¨Ñ.Ô.€DØð Øˆðð ó    Ú	text_listc                 ó„   — t          | |¦  «        }|                     d¦  «        }d„ |D ¦   «         }|r|S d„ |D ¦   «         S )a   
    function responsible for detecting the language from a text

    @param text_list: target batch that you want to detect its language
    @param api_key: your private API key
    @param detailed: set to True if you want to
    get detailed information about the detection process
    r    c                 ó   — g | ]
}|d          ‘ŒS )r   © ©Ú.0Úobjs     r   ú
<listcomp>z#batch_detection.<locals>.<listcomp>b   s   € Ð
(Ð
(Ð
(�cˆ3ˆqŒ6Ð
(Ð
(Ð
(r%   c                 ó   — g | ]
}|d          ‘ŒS )r!   r)   r*   s     r   r-   z#batch_detection.<locals>.<listcomp>f   s   € Ð/Ð/Ð/ C��J”Ð/Ð/Ð/r%   r"   )r&   r   r   r   r   r   r    Úress           r   Úbatch_detectionr0   U   sX   € õ ˜I wÑ/Ô/€DØ—’˜,Ñ'Ô'€JØ
(Ð
(˜ZÐ
(Ñ
(Ô
(€CØð 0Øˆ
à/Ð/¨3Ð/Ñ/Ô/Ð/r%   )NF)F)Ú__doc__Ú__copyright__Útypingr   r   r   r   Úrequests.exceptionsr   r   Ústrr   Úboolr$   r0   r)   r%   r   ú<module>r7      s%  ððð ð 5€à (Ð (Ð (Ð (Ð (Ð (Ð (Ð (Ð (Ð (à €€€Ø )Ð )Ð )Ð )Ð )Ð )ð 6à?Ø$ðð ð
ð 
€ð!Ø
��T˜#”Y�Ô
ð!Ø*-ð!ð !ð !ð !ðL "Øðð Ø
ðà�cŒ]ðð ðð ð ð ð8 :?ð0ð 0Ø�CŒyð0Ø#&ð0Ø26ð0ð 0ð 0ð 0ð 0ð 0r%   