这路径格式只能windows使用了?
Apuyuseng opened this issue · 3 comments
Apuyuseng commented
17 thispath = os.path.split(os.path.realpath(__file__))[0]
---> 18 jieba.set_dictionary(thispath + "\dict\synonymdict.txt")
19 jieba.load_userdict(thispath + "\dict\userdict.txt")
20 import jieba.posseg as posseg
/usr/local/lib/python3.6/site-packages/jieba/init.py in set_dictionary(self, dictionary_path)
485 abs_path = _get_abs_path(dictionary_path)
486 if not os.path.isfile(abs_path):
--> 487 raise Exception("jieba: file does not exist: " + abs_path)
488 self.dictionary = abs_path
489 self.initialized = False
Exception: jieba: file does not exist: /usr/local/lib/python3.6/site-packages/chat\dict\synonymdict.txt
zheyang0715 commented
路径里既有斜杠又有反斜杠,检查好路径,怎么可能只支持windows呢!
Apuyuseng commented
文件路径存在的 ,😁自己动手改源码了
Decalogue commented
谢谢!已经修改,明天推上去。包括一些其他改动。