chore(repo): 优化仓库结构
This commit is contained in:
@@ -56,7 +56,9 @@ class ChineseTypoGenerator:
|
||||
|
||||
# 使用内置的词频文件
|
||||
char_freq = defaultdict(int)
|
||||
dict_path = os.path.join(os.path.dirname(__file__), "dict.txt")
|
||||
# 从当前文件向上返回三级目录到项目根目录,然后拼接路径
|
||||
base_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
|
||||
dict_path = os.path.join(base_dir, "depends-data", "dict.txt")
|
||||
|
||||
# 读取rjieba的词典文件
|
||||
with open(dict_path, encoding="utf-8") as f:
|
||||
|
||||
Reference in New Issue
Block a user