morainzh
V2EX  ›  问与答

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

  •  
  •   morainzh · Apr 9, 2023 · 1595 views
    This topic created in 1130 days ago, the information mentioned may be changed or developed.

    背景如下,我是一名高中生,需要预处理一些文档导入到 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 replies    2023-04-11 23:02:28 +08:00
    TrembleBeforeMe
        1
    TrembleBeforeMe  
       Apr 9, 2023
    Regex.ai – 让 AI 帮你写正则表达式|再也不用学习正则了 https://www.appinn.com/regex-ai/
    hahahahahahahah
        2
    hahahahahahahah  
       Apr 11, 2023 via iPhone
    把文件发一下
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5925 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 03:26 · PVG 11:26 · LAX 20:26 · JFK 23:26
    ♥ Do have faith in what you're doing.