Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env ruby
meta = File.new "meta.txt"
synsets = Hash.new
meta.each_line do |line|
dicts = line.split(" ")
synsets[dicts[1].to_s] = dicts[0].to_i;
end
STDIN.each_line do |line|
dirs = line.split("/")
print synsets[dirs[0]].to_s + " " + line
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment