dongshiliao7990 2013-08-06 16:17
浏览 19

在PHP中查找最相似的字符串?

I have an array of 17,000 strings. Many of the strings have similar matches, for example:

User Report XYZ123
Bob Smith
User Report YEI723
User Report
User Report
Number of Hits 27
Frank's Weekly Transaction Report
Transaction Report 123

What is the best way to find the top "similar strings"? For instance, using the example above, I would want to see "User Report" and "Transaction Report" as two of the top "similar strings".

  • 写回答

4条回答 默认 最新

  • du5910 2013-08-06 16:21
    关注

    Without giving you all the source code to do this, you could go through the array and remove components you consider useless, like any letters with numbers, and so on.

    Then you can use array_count_values() and sort that array to see the top ones involved.

    评论

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改