Skip to content

Instantly share code, notes, and snippets.

@arn-e
Created September 21, 2012 21:17
Show Gist options
  • Save arn-e/3763951 to your computer and use it in GitHub Desktop.
Save arn-e/3763951 to your computer and use it in GitHub Desktop.
match_char
def match_char(hash_results)
dist,dist_c,match_hash = 100,"",Hash.new
hash_results.each { |a,b| @gen_char_freq.each { |c,d| dist,dist_c = (d-b).abs, c if (d-b).abs < dist}
match_hash[a],dist = dist_c,100}
return match_hash
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment