比较文本字符串以查看它们是否匹配(允许轻微差异) [英] Compare text strings to see if they match (allow slight differences)

查看:93
本文介绍了比较文本字符串以查看它们是否匹配(允许轻微差异)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想比较两个来源的资料。

I'm trying to compare data from two sources.

ORIG Kick-Ass: Music From The Motion Picture
ALT Kick-A*s (Music from the Motion Picture)
ALT Kick-Ass: (Music from the Motion Picture)[Explicit]
ALT Kick-Ass: A dedication

ALT 1 ALT 2和ORIG是相同的匹配。 ALT 3是一个虚拟结果。

ALT 1 ALT 2 and ORIG are the same match. ALT 3 is a dummy result.

我需要验证这些是否匹配,在PHP库中是否有任何方法可用。
我想用count_chars计数每个单独的字符,然后比较使用百分比匹配的ORIG字符串。

I need to verify that these have a match, is there any methods available to me within the PHP library. I was thinking of counting each individual character with count_chars, then comparing that do the ORIG string using a percentage match. However if its a short title it wouldn't work too well.

你有什么想法我如何验证他们匹配,

Do you have any ideas how I could verify that they match,

干杯,

J

推荐答案

嗯,总是有 levenshtein距离,但我不知道最终的有用性

Well, there's always the levenshtein distance, but I'm not sure how ultimately useful that would be for you.

可以值得一试

这篇关于比较文本字符串以查看它们是否匹配(允许轻微差异)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆