<commit_before>package org.mskcc.cbio.annotator;

import java.io.File;
import java.io.IOException;
import java.util.Date;

import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.CmdLineException;
import org.mskcc.cbio.oncotator.OncotateTool;

/**
 * Command Line Tool to Annotate a Single Input File.
 *
 * @author <NAME>
 */
public class AnnotateTool
{
	public static void main(String[] args)
	{
		AnnotatorConfig config = new AnnotatorConfig();
		CmdLineParser parser = new CmdLineParser(config);

		// try to parse the command line arguments
		try {
			parser.parseArgument(args);
		} catch( CmdLineException e ) {
			// print the error message
			System.out.println(e.getMessage());
			// print the usage
			parser.printUsage(System.out);
			// terminate
			return;
		}

		int result = 0;

		try
		{
			if (config.getAnnotator().equalsIgnoreCase("oncotator"))
			{
				result = OncotateTool.driver(config);
			}
			else
			{
				result = driver(config);
			}
		}
		catch (RuntimeException e)
		{
			System.out.println("Fatal error: " + e.getMessage());
			e.printStackTrace();
		}
		finally
		{
			// check errors at the end<commit_msg>small improvement for the annotator error messages<commit_after>package org.mskcc.cbio.annotator;

import java.io.File;
import java.io.IOException;
import java.util.Date;

import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.CmdLineException;
import org.mskcc.cbio.oncotator.OncotateTool;

/**
 * Command Line Tool to Annotate a Single Input File.
 *
 * @author <NAME>
 */
public class AnnotateTool
{
	public static void main(String[] args)
	{
		AnnotatorConfig config = new AnnotatorConfig();
		CmdLineParser parser = new CmdLineParser(config);

		// try to parse the command line arguments
		try {
			parser.parseArgument(args);
		} catch( CmdLineException e ) {
			// print the error message
			System.out.println("Error: ");
			System.out.println(e.getMessage());
			System.out.println("");
			// print the usage
			System.out.println("Usage: ");
			parser.printUsage(System.out);
			// terminate
			return;
		}

		int result = 0;

		try
		{
			if (config.getAnnotator().equalsIgnoreCase("oncotator"))
			{
				result = OncotateTool.driver(config);
			}
			else
			{
				result = driver(config);
			}
		}
		catch (RuntimeException e)
		{
			System.out.println("Fatal error: " + e.getMessage());
			e.printStackTrace();
		}
		finally
		{
			// check errors at the end
{'fraction_non_alphanumeric': 0.12192118226600986, 'fraction_numerical': 0.0024630541871921183, 'mean_word_length': 3.406871609403255, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1115719', 'n_tokens_mistral': 943, 'n_tokens_neox': 814, 'n_words': 184}