| | |
| | | if vehicles != nil { |
| | | for _,veh := range vehicles { |
| | | if veh.PlateNo != "" { |
| | | ncStr := veh.PlateNo[1:] //把第一位汉字剔除掉 |
| | | r := []rune(veh.PlateNo) |
| | | ncStr := string(r[1:]) //把第一位汉字剔除掉 |
| | | myPlateNosMap[ncStr] = ncStr |
| | | } |
| | | //myPlateNosMap[veh.PlateNo] = veh.PlateNo |
| | |
| | | //1.目前有误识别的问题,会把D识别成0,D和0不分 |
| | | //2.汉字误识别的几率比较高 |
| | | func isMyPlateNo(plateNoM map[string]string, targetPlateNo string) bool { |
| | | if targetPlateNo == "京N34809"{ |
| | | fmt.Println("isMyPlateNo plateNoM:", plateNoM) |
| | | } |
| | | if targetPlateNo != "" { |
| | | nctPlateNo := targetPlateNo[1:] |
| | | r := []rune(targetPlateNo) |
| | | nctPlateNo := string(r[1:]) |
| | | |
| | | if _,exist := plateNoM[nctPlateNo];exist { |
| | | return true |
| | | } else { |
| | |
| | | newK := strings.ReplaceAll(k, "D", "*") |
| | | newK = strings.ReplaceAll(newK, "0", "*") |
| | | |
| | | tt := strings.ReplaceAll(targetPlateNo,"D", "*") |
| | | tt := strings.ReplaceAll(nctPlateNo,"D", "*") |
| | | tt = strings.ReplaceAll(tt,"0", "*") |
| | | if newK == tt { |
| | | match = true |