Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true do
- to_test = files.first
- max_size = 0
- max_common = ""
- files.each do |f|
- if f != to_test
- common = Util::longest_common_substring(to_test, f)
- if common.size > max_size && f.size - common.size >= mindiff
- max_common = common
- max_size = common.size
- end
- end
- end
- print max_common + "\n"
- blocks[max_common] = files.select { |s| s.include? max_common }
- files.select! { |s| !s.include? max_common }
- if files.size == 0
- break
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement