@ -1,5 +1,4 @@
import threading
import threading, queue
import queue
from cppy.cp_util import *
# 处理单词
@ -1,4 +1,4 @@
import threading, queue, operator
class WordFrequencyCounter:
@ -49,9 +49,8 @@ def load_file_into_database(path_to_file, connection):
# 建数据库,处理数据入库
#######################################################
# 获取当前文件所在的目录
current_dir = os.path.dirname(os.path.abspath(__file__))
# 构造数据库文件的完整路径
db_file_path = os.path.join(current_dir, db_filename)
if os.path.exists(db_file_path):
@ -3,6 +3,9 @@ import aiofiles
from collections import Counter
#
# 协程
async def read_file(file_path):
async with aiofiles.open(file_path, 'r', encoding='utf-8') as file:
content = await file.read()