Python string pattern recognition/compression

前端 未结 6 902
隐瞒了意图╮
隐瞒了意图╮ 2021-02-15 14:45

I can do basic regex alright, but this is slightly different, namely I don\'t know what the pattern is going to be.

For example, I have a list of similar strings:

<
6条回答
  •  野的像风
    2021-02-15 15:32

    This look much like the LZW algorithm for data (text) compression. There should be python implementations out there, which you may be able to adapt to your need.

    I assume you have no a priori knowledge of these sub strings that repeat often.

提交回复
热议问题