V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
godblessumilk
V2EX  ›  算法

[救救孩子] 有多个段落,如何提取出在每个段落中都出现过的 字/词/句/段落 ?

  •  
  •   godblessumilk · 2021-08-30 16:57:00 +08:00 · 667 次点击
    这是一个创建于 941 天前的主题,其中的信息可能已经有所发展或是发生改变。
    有五个段落:

    para1 = "this is para one. I am cat. I am 10 years old. I like fish"
    para2 = "this is para two. I am dog. my age is 12. I can swim"
    para3 = "this is para three. I am cat. I am 9 years. I like rat"
    para4 = "this is para four. I am rat. my age is secret. I hate cat"
    para5 = "this is para five. I am dog. I am 10 years old. I like fish"

    希望提取得到如下结果:

    this is para
    I am
    I

    爸爸们,咋整?或者有没有现成的好用的 diff 工具能让我构造一条命令去执行系统调用,然后接收它的输出呜呜呜
    MorningStar0
        1
    MorningStar0  
       2021-08-30 17:41:17 +08:00
    直接上后缀树
    godblessumilk
        2
    godblessumilk  
    OP
       2021-08-30 17:47:30 +08:00
    @MorningStar0 后缀树上后缀果
    godblessumilk
        3
    godblessumilk  
    OP
       2021-08-30 17:48:03 +08:00
    Grouie
        4
    Grouie  
       2021-08-31 09:04:51 +08:00 via iPhone
    tf-idf
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1131 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 18:41 · PVG 02:41 · LAX 11:41 · JFK 14:41
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.