V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
morainzh
V2EX  ›  问与答

关于一个文本处理的小问题

  •  
  •   morainzh · 2023-04-09 19:15:14 +08:00 · 764 次点击
    这是一个创建于 383 天前的主题,其中的信息可能已经有所发展或是发生改变。

    背景如下,我是一名高中生,需要预处理一些文档导入到 anki 中平时背诵。

    文档内容包含英文单词,英文短语,英文例句及其对应的中文释义

    原始文本长这样

    10.consultant  n. 顾问,咨询者,会诊医生 v. consult      n.consultation 咨询
    consultant fee  咨询费        financial consultant  财务顾问
    I will have to consult the plane time table first.(我得先查阅飞机时刻表。)
    11.receptionist  n.  接待员,前台小姐 n.  reception 接待仪式;招待会;接待区;接待
    v. receive 收到;经受;接见,招待;接纳;回应;接收
    Low achievers in schools will receive priority.   (在学校里成绩较差的人会拥有优先权。)
    My speech was very well received.(我的报告受到了热烈的欢迎。)
    She was warmly received.(她受到热情地接待。)
    

    我需要处理成严格的中文+|+英文\n 像这样

    10.consultant  |n. 顾问,咨询者,会诊医生
    v. consult n.consultation|咨询
    consultant fee  |咨询费        
    financial consultant  |财务顾问
    I will have to consult the plane time table first.|(我得先查阅飞机时刻表。)
    

    我不太会正则这些东西,感觉 python 什么的也不太好处理,请问各位大神有无解决方案

    小额有偿也可,先谢过了

    2 条回复    2023-04-11 23:02:28 +08:00
    TrembleBeforeMe
        1
    TrembleBeforeMe  
       2023-04-09 20:56:58 +08:00
    Regex.ai – 让 AI 帮你写正则表达式|再也不用学习正则了 https://www.appinn.com/regex-ai/
    hahahahahahahah
        2
    hahahahahahahah  
       2023-04-11 23:02:28 +08:00 via iPhone
    把文件发一下
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2695 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 11:01 · PVG 19:01 · LAX 04:01 · JFK 07:01
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.