结构调整

pull/14/head
zj3D 8 months ago
parent 9bf690d62c
commit 2518a5cd85

@ -1,5 +1,4 @@
import threading
import queue
import threading, queue
from cppy.cp_util import *
# 处理单词

@ -1,4 +1,4 @@
import threading, queue, operator
import threading, queue
from cppy.cp_util import *
class WordFrequencyCounter:

@ -49,9 +49,8 @@ def load_file_into_database(path_to_file, connection):
# 建数据库,处理数据入库
#######################################################
# 获取当前文件所在的目录
current_dir = os.path.dirname(os.path.abspath(__file__))
# 构造数据库文件的完整路径
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
from cppy.cp_util import *
#
# 协程
#
async def read_file(file_path):
async with aiofiles.open(file_path, 'r', encoding='utf-8') as file:
content = await file.read()

Loading…
Cancel
Save