diff --git a/HisenceYoloDetection/MainForm.cs b/HisenceYoloDetection/MainForm.cs index cc2a2a1..29f18a3 100644 --- a/HisenceYoloDetection/MainForm.cs +++ b/HisenceYoloDetection/MainForm.cs @@ -189,8 +189,8 @@ namespace HisenceYoloDetection private void MainForm_Load(object sender, EventArgs e) { - string s1 = "ECO4060##Coton20℃##Rapide15mns"; - string s2 = "Eco4060##Coton20℃##Rapide15mns"; + string s1 = "0##Ec04060##20℃##Rapide15mns"; + string s2 = "ECO4060##20°C##Rapide15mns"; bool st = ManagerModelHelper.StrMatch2(s1, s2); @@ -2727,7 +2727,7 @@ namespace HisenceYoloDetection myLog("插入每块板需要的时间" + sw.ElapsedMilliseconds, DateTime.Now); keyValueResult.Add(blockIndex, blockMatchI); - + } diff --git a/HisenceYoloDetection/ManagerModelHelper.cs b/HisenceYoloDetection/ManagerModelHelper.cs index bc5a96f..d77cd96 100644 --- a/HisenceYoloDetection/ManagerModelHelper.cs +++ b/HisenceYoloDetection/ManagerModelHelper.cs @@ -227,10 +227,13 @@ namespace HisenceYoloDetection } static bool AreMoreThanHalfEqual(string[] array1, string[] array2) { + string Sqltext = array1.Join(""); + string Realtext = array2.Join(""); int io = 0; - foreach (string ch1 in array1) + + foreach (char ch2 in Realtext) { - foreach (string ch2 in array2) + foreach (char ch1 in Sqltext) { if (ch1 == ch2) { @@ -249,7 +252,7 @@ namespace HisenceYoloDetection //int intersectionCount = set1.Intersect(set2).Count(); // 鍒ゆ柇浜ら泦鏁伴噺鏄惁瓒呰繃涓鍗 - return io > array1.Length / 2; + return io >=Sqltext.Length / 2; } public static bool StrMatch2(string SqlText, string DetText) { @@ -277,7 +280,7 @@ namespace HisenceYoloDetection Console.WriteLine("瀛楃涓蹭腑涓嶅寘鍚暟瀛"); } bool areEqual ; - if (numbers2.Length>2&& numbers.Length > 2) + if (numbers2.Length>0&& numbers.Length > 0) { areEqual = AreMoreThanHalfEqual(numbers, numbers2); }