You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

27 lines
998 B

import json, sys, re
sys.stdout.reconfigure(encoding='utf-8')
def load(path):
d = json.load(open(path, encoding='utf-8'))
return d['result']['content'][0]['text']
text = load(sys.argv[1])
# 按页拆分:developer 分析通常按页面分段
# 先输出整体结构线索:所有标题行 + 含按钮/操作/弹窗/点击/批量 的行(截断每行)
keys = re.compile(r'按钮|操作|弹窗|点击|批量|领取|释放|分配|关注|反馈|转商机|删除|激活|编辑|新增|导入|导出|筛选|搜索|分页|tab|Tab|切换|下拉|表单|必填|校验|统计|卡片|列设置|视图')
out = []
for i, line in enumerate(text.split('\n')):
s = line.strip()
if not s:
continue
if keys.search(s):
out.append(s[:200])
# 去重保持顺序
seen = set()
final = []
for s in out:
if s not in seen:
seen.add(s)
final.append(s)
print('\n'.join(final[:400]))
print(f'\n=== total matched lines: {len(final)} (of text {len(text)} chars) ===')