chore(repo): 优化仓库结构

This commit is contained in:
minecraft1024a
2025-10-06 20:55:46 +08:00
parent d2c4726ad1
commit 206b35fff3
2 changed files with 3 additions and 1 deletions

View File

@@ -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: