#region 高效比对返回匹配度最高的数据
/// <summary>
/// 高效比对返回匹配度最高的数据
/// </summary>
/// <param name="sourceList">源数据</param>
/// <param name="targetList">目标数据</param>
/// <returns></returns>
public static List<MapToData> GetAutoMapData(List<MapToData> sourceList, List<MapToData> targetList)
{
#region 高效计算匹配
List<MapToData> resultList = new List<MapToData>();
Parallel.For(0, sourceList.Count, i =>
{
var sourceValue = sourceList[i].key;
foreach (var item in targetList)
{
var targetValue = item.key;
var jsonObject = item.value;
int matchNum = LevenshteinDistance(sourceValue, targetValue);
resultLi
高效比对,返回最短编辑距离算法匹配度最高的数据
最新推荐文章于 2021-01-17 16:47:12 发布