<commit_before>import net.bitform.api.options.AnalyzeOption;
import net.bitform.api.options.Option;
import net.bitform.api.options.ScrubOption;
import net.bitform.api.secure.SecureOptions;
import net.bitform.api.secure.SecureRequest;
import net.bitform.api.secure.SecureResponse;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;

public class ExtractTextFromFile {
	public void getText(String inputFile) {

		/**
		 * Check the command line
		 */

		File file = null;

		file = new File(inputFile);

		if (!file.exists() || !file.isFile()) {
			System.out.println(file.toString() + " is not a valid file");
			return;
		}

		/**
		 * Create and setup the SecureRequest object
		 */
		SecureRequest request = new SecureRequest();
		/* ScrubbedDocument: FileOption */
		//File scrubbedFile = new File("/tmp/output.bin");
		File outputFile = new File("/tmp/output.txt");
		request.setOption(SecureOptions.JustAnalyze, true);
		//request.setOption(SecureOptions.ScrubbedDocument, scrubbedFile);
		request.setOption(SecureOptions.SourceDocument, file);
		request.setOption(SecureOptions.ResultDocument, outputFile);
		request.setOption(SecureOptions.OutputType, SecureOptions.OutputTypeOption.ToText);
		request.setOption(SecureOptions.ToTextEncoding, SecureOptions.ToTextEncodingOption.UTF8);
		try	{
			/**
			 * Execute the request
			 */
<commit_msg>Allow specification of the output filename for text.<commit_after>import net.bitform.api.options.AnalyzeOption;
import net.bitform.api.options.Option;
import net.bitform.api.options.ScrubOption;
import net.bitform.api.secure.SecureOptions;
import net.bitform.api.secure.SecureRequest;
import net.bitform.api.secure.SecureResponse;
import java.io.File;
import java.io.IOException;

public class ExtractTextFromFile {
	public void getText(String inputFn, String outputFn) {

		/**
		 * Check the command line
		 */

		File file = null;

		file = new File(inputFn);

		if (!file.exists() || !file.isFile()) {
			System.out.println(file.toString() + " is not a valid file");
			return;
		}

		/**
		 * Create and setup the SecureRequest object
		 */
		SecureRequest request = new SecureRequest();
		/* ScrubbedDocument: FileOption */
		//File scrubbedFile = new File("/tmp/output.bin");
		File outputFile = new File(outputFn);
		request.setOption(SecureOptions.JustAnalyze, true);
		//request.setOption(SecureOptions.ScrubbedDocument, scrubbedFile);
		request.setOption(SecureOptions.SourceDocument, file);
		request.setOption(SecureOptions.ResultDocument, outputFile);
		request.setOption(SecureOptions.OutputType, SecureOptions.OutputTypeOption.ToText);
		request.setOption(SecureOptions.ToTextEncoding, SecureOptions.ToTextEncodingOption.UTF8);
		try	{
			/**
			 * Execute the request
			 */

{'fraction_non_alphanumeric': 0.1187477509895646, 'fraction_numerical': 0.0007196833393306944, 'mean_word_length': 4.650406504065041, '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': '7523028', 'n_tokens_mistral': 932, 'n_tokens_neox': 836, 'n_words': 169}