<commit_before>package com.mb.demo;

import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;

import com.mb.strategy.DocReader;
import com.mb.strategy.DocxReader;
import com.mb.strategy.ReaderContext;

/**
 * 
 * @author <NAME>
 *
 */
public class ReadWordFileDemo {

	final private static String DOC_EXTENSION = ".doc";
	final private static String DOCX_EXTENSION = ".docx";

	public static void main(final String[] args) {
		if(args.length == 0){
			System.out.println("No file name provided");
			System.exit(0);
		} 
		
		final String inputFileName = args[0];

		boolean isDoc = inputFileName.endsWith(DOC_EXTENSION),
				isDocx = inputFileName.endsWith(DOCX_EXTENSION);
		
		ReaderContext ctx = new ReaderContext();
		
		if(isDoc){
			ctx.setStrategy(new DocReader());
		} else if(isDocx){
			ctx.setStrategy(new DocxReader());
		} else {
			System.out.println("Unsuported file format");
			System.exit(0);
		}
		
		try {
			List<String> movieNames = ctx.readFile(inputFileName);
			
			final String outputFileName = inputFileName.substring(0, inputFileName.lastIndexOf('/') + 1) + "output.txt"; 
			Path file = FileSystems.getDefault().getPath(outputFileName);
			Files.write(file, movieNames, Charset.forName("UTF-8"));
		} catch (IOException e) {
			e.printStackTrace();

			System.out.println("Could not write to output file");
			System.exit(0);
		} 
	}
}<commit_msg>cleaned ReadWordFileDemo<commit_after>package com.mb.demo;

import com.mb.strategy.DocReader;
import com.mb.strategy.DocxReader;
import com.mb.strategy.ReaderContext;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;

/**
 * @author <NAME>
 */
public class ReadWordFileDemo {

    public static void main(final String[] args) {
        if (args.length == 0) {
            System.out.println("No file name provided");
            System.exit(0);
        }

        final String inputFileName = args[0];

        final boolean isDoc = inputFileName.endsWith(DocReader.DOC_FILE_TYPE_EXTENSION),
                isDocx = inputFileName.endsWith(DocxReader.DOCX_FILE_TYPE_EXTENSION);

        final ReaderContext ctx = new ReaderContext();

        if (isDoc) {
            ctx.setStrategy(new DocReader());
        } else if (isDocx) {
            ctx.setStrategy(new DocxReader());
        } else {
            System.out.println("Unsuported file format");
            System.exit(0);
        }

        try {
            final List<String> movieNames = ctx.readFile(inputFileName);

            final String outputFileName = inputFileName.substring(0, inputFileName.lastIndexOf('/') + 1) + "output.txt";
            final Path file = FileSystems.getDefault().getPath(outputFileName);
            Files.write(file, movieNames, StandardCharsets.UTF_8);
        } catch (IOException e) {
            e.printStackTrace();

            System.out.println("Could not write to output file");
            System.exit(0);
        }
    }
}
{'fraction_non_alphanumeric': 0.12396956246036779, 'fraction_numerical': 0.0050729232720355105, 'mean_word_length': 3.1404199475065617, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6952828', 'n_tokens_mistral': 1045, 'n_tokens_neox': 955, 'n_words': 202}