class HadoopTwitterTokenTool extends Configured implements Tool {

	public static void main(String[] args) throws Exception {
		try {
			ToolRunner.run(new HadoopTwitterTokenTool(args), args);
		} catch (CmdLineException e) {
			System.err.print(e);
		}
	}

}

class HadoopTwitterTokenToolTest {

	@Rule
	public TemporaryFolder folder;
	private String hadoopCommand;
	private File outputLocation;
	private File resultsOutputLocation;
	private File stemmedTweets;
	private File jsonTweets;
	private File monthLongTweets;
	private static final String JSON_TWITTER;
	private static int counter;

	@Test
	public void testMonthLongDFIDFCSVByTime() throws Exception {

//		hadoopCommand = "-i %s -o %s -om %s -ro %s -m %s -j %s -t 1 -wt . -wt !";
		String command = String.format(hadoopCommand,
				monthLongTweets.getAbsolutePath(),
				outputLocation.getAbsolutePath(), "CSV",
				resultsOutputLocation.getAbsolutePath(), "DFIDF",
				"analysis.stemmed");
		command += " -svbt";
		String[] args = command.split(" ");
		args = (String[]) ArrayUtils.addAll(args, new String[] { "-pp","-m PORTER_STEM" });
		System.out.println(Arrays.toString(args));
		HadoopTwitterTokenTool.main(args);
		Path p = new Path(resultsOutputLocation.getAbsolutePath());
		System.out.println(p);
	}

}