U
    m§iº  ã                   @   s`   d dl Z d dlZe jj d¡ d dlmZ dddddd	d
ddddgZe d¡e Z	ddd„Z
dS )é    Nz./data/nltk_data)Ú	stopwordsZcomputerZ	computersZlaptopZlaptopsÚthingÚthingsÚmachineZmachinesÚimÚdontÚiveÚenglishc                 C   sN   d  dd„ | D ƒ¡}d  dd„ | ¡ D ƒ¡}|d krFdd„ | ¡ D ƒS |S d S )NÚ c                 S   s   g | ]}|t jkr|‘qS © )ÚstringÚpunctuation)Ú.0Úcharr   r   ú-/var/www/sinfronteras/sentiment-dash/utils.pyÚ
<listcomp>   s     
 z"pre_processing.<locals>.<listcomp>ú c                 S   s   g | ]}|  ¡ tkr|‘qS r   )ÚlowerÚstopwords_total©r   Úwordr   r   r   r      s      c                 S   s   g | ]}|‘qS r   r   r   r   r   r   r      s     )ÚjoinÚsplit)ZtextoÚtokenizeZtext_processr   r   r   Úpre_processing   s
    r   )N)Únltkr   ÚdataÚpathÚappendÚnltk.corpusr   Zstopwords_brands_additionalsÚwordsr   r   r   r   r   r   Ú<module>   s   