biliangltd / wordsimilarity Goto Github PK
View Code? Open in Web Editor NEW基于哈工大同义词词林扩展版的单词相似度计算方法
License: Apache License 2.0
基于哈工大同义词词林扩展版的单词相似度计算方法
License: Apache License 2.0
def _load_cilin(self, file_path):
'''
加载词林数据。
:return:
'''
file_obj = open(file_path, 'r', encoding='UTF-8')
line_num = 0
while True:
line_num += 1
line = file_obj.readline()
能否实现同义词查询功能
Traceback (most recent call last): File "D:/projects/miscellaneous/test.py", line 5, in <module> ws_tool = WordSimilarity2010() File "C:\Users\00015426\AppData\Local\Programs\Python\Python37\lib\site-packages\word_similarity\__init__.py", line 101, in __init__ super(WordSimilarity2010, self).__init__() File "C:\Users\00015426\AppData\Local\Programs\Python\Python37\lib\site-packages\word_similarity\__init__.py", line 20, in __init__ self._load_cilin(t_cilin_path) File "C:\Users\00015426\AppData\Local\Programs\Python\Python37\lib\site-packages\word_similarity\__init__.py", line 45, in _load_cilin line = file_obj.readline() UnicodeDecodeError: 'gbk' codec can't decode byte 0xba in position 11: illegal multibyte sequence
希望作者可以增加编码兼容,比如说file_obj = open(file_path, 'r', encoding="utf-8")
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.