class WordNet
    #TODO
end

if ARGV.length < 3 || ARGV.length > 5
  fail "usage: wordnet.rb <synsets file> <hypersets file> <command> <filename>"
end

synsets_file = ARGV[0]
hypernyms_file = ARGV[1]
command = ARGV[2]
fileName = ARGV[3]

#Refers to number of input lines in file
commands_with_0_input = %w(edges nouns)
commands_with_1_input = %w(outcast isnoun)
commands_with_2_input = %w(length ancestor)

case command
when "root"
	file = File.open(fileName)
	v = file.gets.strip
	w = file.gets.strip
	file.close
    wordnet = WordNet.new(synsets_file, hypernyms_file)   
    puts wordnet.send(command,v,w)
when *commands_with_2_input 
	file = File.open(fileName)
	v = file.gets.split(/\s/).map(&:to_i)
	w = file.gets.split(/\s/).map(&:to_i)
	file.close
    wordnet = WordNet.new(synsets_file, hypernyms_file)
    puts wordnet.send(command,v,w)  
when *commands_with_1_input 
	file = File.open(fileName)
	nouns = file.gets.split(/\s/)
	file.close
    wordnet = WordNet.new(synsets_file, hypernyms_file)
    puts wordnet.send(command,nouns)
when *commands_with_0_input
	wordnet = WordNet.new(synsets_file, hypernyms_file)
	puts wordnet.send(command)
else
  fail "Invalid command"
end