chbrown / liwc-python

Linguistic Inquiry and Word Count (LIWC) analyzer
MIT License
193 stars 50 forks source link

use Traditional_Chinese_LIWC2015 UnicodeDecodeError #17

Closed ysjhs70049 closed 3 years ago

ysjhs70049 commented 3 years ago

import liwc parse, category_names = liwc.load_token_parser('/Downloads/Traditional_Chinese_LIWC2015_Dictionary.dic')

Traceback (most recent call last): File "C:/Users/Desktop/test.py", line 4, in parse, category_names = liwc.load_token_parser('/Downloads/Traditional_Chinese_LIWC2015_Dictionary.dic') File "C:\Users\AppData\Local\Programs\Python\Python38\lib\site-packages\liwc__init__.py", line 21, in load_token_parser lexicon, category_names = read_dic(filepath) File "C:\Users\AppData\Local\Programs\Python\Python38\lib\site-packages\liwc\dic.py", line 38, in read_dic for line in lines:

UnicodeDecodeError: 'cp950' codec can't decode byte 0xbf in position 2: illegal multibyte sequence

What can I do to solve this problem?