# coding=utf-8
import os
import concurrent
import threading
import asyncio
gPool = concurrent.futures.ThreadPoolExecutor(5)
gLock = threading.Lock()
async def dealOne(path):
words = {}
with open(path, "r") as f:
while True:
line = f.readline()
if not line:
break
idx = line.find("]")
if idx != -1:
text = line[idx+1:].strip().strip(";").strip()
sp = text.split()
for s in sp:
douhao = s.split(",")
for dou in douhao:
fenhao = dou.split(";")
for fen in fenhao:
juhao = fen.split(".")
for ju in juhao:
wenhao = ju.split("?")
python 计算lrc中不重复单词数量
最新推荐文章于 2023-11-29 23:56:08 发布
本文介绍了如何使用Python实现LRU(Least Recently Used)缓存,并通过示例展示了如何统计缓存中不重复的单词数量。通过理解和应用LRU策略,可以优化数据访问效率。
摘要由CSDN通过智能技术生成