#!/usr/bin/ruby

# The reducer for the simple count application: output the number of sentences a word appears in.

# The reducer reads a key followed by a bunch of 1's from standard input,
# and outputs the key followed by the numner of sentences

while (line = gets)
  line_list = line.split
  word = line_list.shift
  print word , "\t", line_list.length, "\n"
end
