Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emoteicon decoding #16

Closed
Thicool opened this issue Oct 26, 2016 · 1 comment
Closed

Emoteicon decoding #16

Thicool opened this issue Oct 26, 2016 · 1 comment

Comments

@Thicool
Copy link

Thicool commented Oct 26, 2016

Hello together,

does somebody know if there is a simple way to turn utf8 smileys to the ones that the vader_sentiment_lexicon uses?

When i scrape instagram data, python displays the emoteicons the same way as the instgram website, but when i export those posts to csv, i need to decode them.

Thanks for help

@cjhutto
Copy link
Owner

cjhutto commented Dec 13, 2016

I've updated the dictionary file (vader_lexicon.txt) to be UTF-8 compliant with unicode encoding by default now. This might help solve the issue. Also, if you aren't already doing it, try encoding your exported csv file as well, e.g., for Python 3.x

import csv
with open('output_file_name', 'w', newline='', encoding='utf-8') as csv_file:
    writer = csv.writer(csv_file, delimiter=';')
    writer.writerow('my_utf8_string')

@cjhutto cjhutto closed this as completed Mar 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants