package org.academiadecodigo.enuminatti.wordreader;

import java.util.Iterator;

/**
 * MIT License
 * (c) 2017 Ricardo Constantino
 */

public class Main {
    public static void main(String[] args) {

        String filename = "resources/test.txt";

        if (args.length > 0) {
            filename = args[0];
        }

        WordReader wordReader = new WordReader(filename);

        for (String word : wordReader) {
            System.out.println(word);
        }

        System.out.println("\nTotal word count: " + wordReader.getWordCount());

//        Iterator<String> it = wordReader.iterator();
//        while (true) {
//            System.out.println(it.next());
//        }

    }
}
