	public int run(String[] args) throws Exception {
		if (args.length < 3) {
			System.out
					.println("Usage: bin/hadoop jar HadoopGrams.jar org.jovislab.tools.hadoop.hadoopgrams.HadoopGrams <input_file> <output_file> <n> [<filter_class>] [<combiner_threshold>] [<reducer_threshold>]");
			return -1;
		}
		Job job = new Job();
		job.setJarByClass(HadoopGrams.class);
		job.setMapperClass(Map.class);
		job.setCombinerClass(Combine.class);
		job.setReducerClass(Reduce.class);
		job.setOutputKeyClass(Text.class);
		job.setOutputValueClass(LongWritable.class);
		Configuration config = job.getConfiguration();
		config.setInt("n", Integer.parseInt(args[2]));
		if (args.length >= 4) {
			config.setClass("map.filter", Class.forName(args[3]), Filter.class);
		}
		if (args.length >= 5) {
			config.setInt("combine.threshold", Integer.parseInt(args[4]));
		}
		if (args.length >= 6) {
			config.setInt("reduce.threshold", Integer.parseInt(args[5]));
		}
		FileInputFormat.setInputPaths(job, new Path(args[0]));
		FileOutputFormat.setOutputPath(job, new Path(args[1]));
		job.waitForCompletion(true);
		return 0;
	}

	public int run(String[] args) throws Exception {
		if (args.length < 3) {
			System.out.println("Usage: bin/hadoop jar HadoopGrams.jar org.jovislab.tools.hadoop.hadoopgrams.HadoopGrams <input_file> <output_file> <n> [<filter_class>] [<combiner_threshold>] [<reducer_threshold>]");
			return -1;
		}
		Job job = new Job();
		job.setJarByClass(HadoopGrams.class);
		job.setMapperClass(Map.class);
		job.setCombinerClass(Combine.class);
		job.setReducerClass(Reduce.class);
		job.setOutputKeyClass(Text.class);
		job.setOutputValueClass(LongWritable.class);
		Configuration config = job.getConfiguration();
		config.setInt("n", Integer.parseInt(args[2]));
		if (args.length >= 4) {
			config.setClass("map.filter", Class.forName(args[3]), Filter.class);
		}
		if (args.length >= 5) {
			config.setInt("combine.threshold", Integer.parseInt(args[4]));
		}
		if (args.length >= 6) {
			config.setInt("reduce.threshold", Integer.parseInt(args[5]));
		}
		FileInputFormat.setInputPaths(job, new Path(args[0]));
		FileOutputFormat.setOutputPath(job, new Path(args[1]));
		job.waitForCompletion(true);
		return 0;
	}
