What algorithm can you use to find duplicate phrases in a string?

前端 未结 5 1166
广开言路
广开言路 2020-12-15 11:26

Given an arbitrary string, what is an efficient method of finding duplicate phrases? We can say that phrases must be longer than a certain length to be included.

Id

5条回答
  •  猫巷女王i
    2020-12-15 12:07

    Like jmah said, you can use suffix trees/suffix arrays for this.

    There is a description of an algorithm you could use here (see Section 3.1).

    You can find a more in-depth description in the book they cite (Gusfield, 1997), which is on google books.

提交回复
热议问题