o
    hnf"                     @   s    d dl Z d dlmZ dd ZdS )    N)Counterc           	      C   s   zQt | ddd}| }W d    n1 sw   Y  tddtj}|| }| }t	|}t
| dd dd}|D ]\}}td	| d
|  q@W d S  tyc   td|  d Y d S w )Nrzutf-8)encoding c                 S   s   | d S )N    )xr   r   2/workspaces/Masterarbeit/aufgabe_1/word_count_2.py<lambda>   s    zword_count.<locals>.<lambda>T)keyreverse'z': zError: File 'z' not found.)openreadstr	maketransstringpunctuation	translatelowersplitr   sorteditemsprintFileNotFoundError)		file_pathfilecontent
translatorwordsZword_counterZsorted_word_countwordcountr   r   r	   
word_count   s   
r"   )r   collectionsr   r"   r   r   r   r	   <module>   s    