<commit_before>package com.bio4j.exporter;

import java.util.Scanner;

import org.apache.commons.cli.BasicParser;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.OptionBuilder;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;

public class Bio4jExporter {

	public static void main(String[] args) {
		// Gremlin gremlin = GremlinImpl.getInstance().getGremlin();
		Options options = generateOptions();
		BasicParser parser = new BasicParser();
		ExporterCore exporter = new ExporterCore();

		try {
			// parsing the command line arguments
			if (!parseCmdLineArgs(args, options, parser, exporter)) {
				return; // user asked for help, exporter stops
			}

			printBanner();
			Scanner scanIn = new Scanner(System.in);

			if (exporter.getFormat() == null) {
				System.out
				.print("Please state the desired output file format (Gexf/Graphml/GraphSON): ");
				String format = scanIn.nextLine();
				exporter.setFormat(format);
			}
			if (exporter.getSource() == null) {
				System.out.print("Please state input source adress: ");
				String source = scanIn.nextLine();
				exporter.setFormat(source);
			}
			System.out
			.print("Query (expressed in Gremlin Graph Querying Language): ");
			String query = scanIn.nextLine();
			exporter.setQuery(query);

			scanIn.close();

			System.out.print("Running query. . . ");
			exporter.runQuery();

			/* do exporter stuff */

		} catch (Exception exp) {
			System.out.println("Unexpected exception: " + exp.getMessage());
		}
	}

	/**
	 * @param args
	 * @param options
	 * @param parser
	 * @param exporter
	 * @throws ParseException
	 * @throws Exception
	 */
	private static boolean parseCmdLineArgs(String[] args, Options options,
			BasicParser parser, ExporterCore exporter) throws ParseException,
			Exception {

		CommandLine cmd = parser.parse(options, args);

		if (cmd.hasOption("help")) {
			// automatically generate the help statement
			HelpFormatter formatter = new HelpFormatter();
			formatter.printHelp("bio4j-exporter", options);
			return false;
		}

		if (cmd.hasOption("output-format")) {
			exporter.setFormat(cmd.getOptionValue("output-format"));
		}
		if (cmd.hasOption("limit")) {
			exporter.setLimit(cmd.getOptionValue("limit"));
		}
		if (cmd.hasOption("max-time")) {
			exporter.setMaxTime(cmd.getOptionValue("max-time"));
		}
		if (cmd.hasOption("stream")) {
			exporter.setStream(cmd.getOptionValue("stream"));
		}
		if (cmd.hasOption("source")) {
			exporter.setSource(cmd.getOptionValue("source"));
		}
		if (cmd.hasOption("query")) {
			exporter.setSource(cmd.getOptionValue("query"));
		}
		return true;
	}<commit_msg>Fix typo<commit_after>package com.bio4j.exporter;

import java.util.Scanner;

import org.apache.commons.cli.BasicParser;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.OptionBuilder;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;

public class Bio4jExporter {

	public static void main(String[] args) {
		// Gremlin gremlin = GremlinImpl.getInstance().getGremlin();
		Options options = generateOptions();
		BasicParser parser = new BasicParser();
		ExporterCore exporter = new ExporterCore();

		try {
			// parsing the command line arguments
			if (!parseCmdLineArgs(args, options, parser, exporter)) {
				return; // user asked for help, exporter stops
			}

			printBanner();
			Scanner scanIn = new Scanner(System.in);

			if (exporter.getFormat() == null) {
				System.out
						.print("Please state the desired output file format (Gexf/Graphml/GraphSON): ");
				String format = scanIn.nextLine();
				exporter.setFormat(format);
			}
			if (exporter.getSource() == null) {
				System.out.print("Please state input source adress: ");
				String source = scanIn.nextLine();
				exporter.setFormat(source);
			}
			System.out
					.print("Query (expressed in Gremlin Graph Querying Language): ");
			String query = scanIn.nextLine();
			exporter.setQuery(query);

			scanIn.close();

			System.out.print("Running query. . . ");
			exporter.runQuery();

			/* do exporter stuff */

		} catch (Exception exp) {
			System.out.println("Unexpected exception: " + exp.getMessage());
		}
	}

	/**
	 * @param args
	 * @param options
	 * @param parser
	 * @param exporter
	 * @throws ParseException
	 * @throws Exception
	 */
	private static boolean parseCmdLineArgs(String[] args, Options options,
			BasicParser parser, ExporterCore exporter) throws ParseException,
			Exception {

		CommandLine cmd = parser.parse(options, args);

		if (cmd.hasOption("help")) {
			// automatically generate the help statement
			HelpFormatter formatter = new HelpFormatter();
			formatter.printHelp("bio4j-exporter", options);
			return false;
		}

		if (cmd.hasOption("output-format")) {
			exporter.setFormat(cmd.getOptionValue("output-format"));
		}
		if (cmd.hasOption("limit")) {
			exporter.setLimit(cmd.getOptionValue("limit"));
		}
		if (cmd.hasOption("max-time")) {
			exporter.setMaxTime(cmd.getOptionValue("max-time"));
		}
		if (cmd.hasOption("stream")) {
			exporter.setStream(cmd.getOptionValue("stream"));
		}
		if (cmd.hasOption("source")) {
			exporter.setSource(cmd.getOptionValue("source"));
		}
		if (cmd.hasOption("query")) {
			exporter.setQuery(cmd.getOptionValue("query"));
		}
		return true;
	}
{'fraction_non_alphanumeric': 0.13906307635558834, 'fraction_numerical': 0.0011066027296200663, 'mean_word_length': 4.012014787430684, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3949711', 'n_tokens_mistral': 1923, 'n_tokens_neox': 1651, 'n_words': 359}