Print distance with duplicates

This commit is contained in:
Jan Bader 2023-12-06 15:08:07 +01:00
parent eb25a625cb
commit 6059baeeeb

13
main.go
View File

@ -180,24 +180,27 @@ func main() {
if fileIndex == otherIndex { if fileIndex == otherIndex {
continue continue
} }
otherFile := filesMap.Files[otherIndex] otherFile := filesMap.Files[otherIndex]
var distance = hamming.Uint64(file.hash, otherFile.hash) var distance = hamming.Uint64(file.hash, otherFile.hash)
if distance > 5 { if distance > 5 {
continue continue
} }
if len(currentCluster) == 1 {
fmt.Println(currentCluster[0].path)
countDupeSets++
countInstances++
}
currentCluster = append(currentCluster, otherFile) currentCluster = append(currentCluster, otherFile)
fmt.Println(otherFile.path, distance)
countInstances++
} }
if len(currentCluster) <= 1 { if len(currentCluster) <= 1 {
continue continue
} }
countDupeSets++
for _, file := range currentCluster {
countInstances++
fmt.Println(file.path)
}
fmt.Println() fmt.Println()
} }