Comments (4)
I've managed to solve this issue myself by accessing to the liwc/liwc/dic.py file and changing the read_dic(filepath) method to read my file using the utf-8 encoding.
from liwc-python.
I've managed to solve this issue myself by accessing to the liwc/liwc/dic.py file and changing the read_dic(filepath) method to read my file using the utf-8 encoding.
Thank you for sharing your own solution. I would appreciate if you provided the details about it.
I just added encoding='utf-8'
to liwc/liwc/dic.py, but apparently that is not right, because I keep getting "KeyError: '8'"
with open(filepath, encoding='utf-8') as lines:
By the way, I am trying to use this library not with a Spanish but with a German (from 2001) version. That is why I think your suggested solution might make this library work with the German 2001 .dic
from liwc-python.
I've managed to solve this issue myself by accessing to the liwc/liwc/dic.py file and changing the read_dic(filepath) method to read my file using the utf-8 encoding.
Thank you for sharing your own solution. I would appreciate if you provided the details about it.
I just addedencoding='utf-8'
to liwc/liwc/dic.py, but apparently that is not right, because I keep getting "KeyError: '8'"
with open(filepath, encoding='utf-8') as lines:
By the way, I am trying to use this library not with a Spanish but with a German (from 2001) version. That is why I think your suggested solution might make this library work with the German 2001 .dic
That's exactly what we did, I noticed that by applying that tiny change our code worked but I'm not sure If maybe it should also be changed somewhere else. Have you debuggered your code?
from liwc-python.
I've managed to solve this issue myself by accessing to the liwc/liwc/dic.py file and changing the read_dic(filepath) method to read my file using the utf-8 encoding.
Thank you for sharing your own solution. I would appreciate if you provided the details about it.
I just addedencoding='utf-8'
to liwc/liwc/dic.py, but apparently that is not right, because I keep getting "KeyError: '8'"
with open(filepath, encoding='utf-8') as lines:
By the way, I am trying to use this library not with a Spanish but with a German (from 2001) version. That is why I think your suggested solution might make this library work with the German 2001 .dicThat's exactly what we did, I noticed that by applying that tiny change our code worked but I'm not sure If maybe it should also be changed somewhere else. Have you debuggered your code?
Thank you very much for your quick reply. I actually haven't debugged the code. I don't find another solution for that, I will do that and post a reply.
By the way, I faced exactly the same situation with another LIWC python library and open an issue there
from liwc-python.
Related Issues (17)
- key error HOT 3
- KeyError for LIWC2007_English150202_STRESS.dic HOT 4
- convert the text to lower case HOT 1
- .dic file can't be found on ubuntu server when running liwc example
- KeyError: 8 German 2001 .dic HOT 1
- use Traditional_Chinese_LIWC2015 UnicodeDecodeError
- how to calculate the summary variables
- AttributeError: 'module' object has no attribute 'load_token_parser' HOT 2
- AttributeError: module 'liwc' has no attribute 'load_token_parser' HOT 6
- Support for LIWC2015 HOT 9
- Moral Foundations LIWC dictionary HOT 1
- Where you do locate the LIWC English dictionary once you purchase the LIWC license? HOT 42
- Key Error (revisted!) HOT 4
- How to add some changes?
- No update code in PyPI HOT 2
- How to show the specific category only? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from liwc-python.