int numWordsToPrint) throws IOException {
FileSystem fs = new Path(dir).getFileSystem(job);
List<PriorityQueue<StringDoublePair>> queues = new ArrayList<PriorityQueue<StringDoublePair>>();
IntPairWritable key = new IntPairWritable();
DoubleWritable value = new DoubleWritable();
for (FileStatus status : fs.globStatus(new Path(dir, "*"))) {
Path path = status.getPath();
SequenceFile.Reader reader = new SequenceFile.Reader(fs, path, job);
while (reader.next(key, value)) {
int topic = key.getFirst();
int word = key.getSecond();
ensureQueueSize(queues, topic);
if (word >= 0 && topic >= 0) {
double score = value.get();
String realWord = wordList.get(word);