a
    Cg<                     @   s   d Z ddlmZ ddlmZmZ zddlmZ dd ZW nB e	yz   zddlmZ W n e	yt   ddl
mZ Y n0 Y n0 d	Zi Zd
d ZdS )z Unicode to ASCII transliteration    )intern)	MAX_WBITS
decompress)filesc                 C   s   t | | S )N)r   joinpath
read_bytes)packageresource r
   P/var/www/lab.imftr.de/x/nb_venv/lib/python3.9/site-packages/anyascii/__init__.pyread_binary	   s    r   )r   )get_dataz0.3.2c           	      C   s   z|   r| W S W n ty$   Y n0 g }| D ]}t|}|dkrN|| q.|d? }|d@ }zt| }W nj ty   z8tdd| }t|t 	d}t
tt|d}W n ty   d}Y n0 |t|< Y n0 t||kr.|||  q.d	|S )
z"Transliterate a string into ASCII.         zanyascii._dataz%03xascii	r
    )isasciiAttributeErrorordappend_blocksKeyErrorr   r   r   decodetuplemapr   splitFileNotFoundErrorlenjoin)	stringresultchar	codepointblocknumloblockbsr
   r
   r   anyascii   s4    


r*   N)__doc__sysr   zlibr   r   importlib.resourcesr   r   ImportErrorpkgutilr   __version__r   r*   r
   r
   r
   r   <module>   s   