Skip to content

Instantly share code, notes, and snippets.

@liuliu
Created January 13, 2014 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save liuliu/8393461 to your computer and use it in GitHub Desktop.
Save liuliu/8393461 to your computer and use it in GitHub Desktop.
#!/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