<commit_before>package com.ocrapp;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Environment;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.EditText;

import com.ocrapp.imageui.ImagePreprocessor;
import com.ocrapp.savetoformat.SaveFormatActivity;

public class TextPreview extends Activity {
	
	private EditText textView;
	private String text;
	private final String modifiedImageDirectory = Environment.getExternalStorageDirectory() + "/tesseract/modimage.png";

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_text_preview);
		textView = (EditText) findViewById(R.id.editText1);
		
		text = getIntent().getExtras().getString("text");
		textView.setText(text);
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.text_preview, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		int id = item.getItemId();
		if (id == R.id.action_settings) {
			return true;
		}
		else if(id == R.id.OK){
			Intent i = new Intent(this, SaveFormatActivity.class);
			i.putExtra("text", textView.getText());
			startActivity(i);
			return true;
		}
		else if(id == R.id.cancel){
			Intent i = new Intent(this, ImagePreprocessor.class);
			i.putExtra("file", modifiedImageDirectory);
			startActivity(i);
			return true;
		}
		return super.onOptionsItemSelected(item);
	}
}
<commit_msg>Fixed text preview edit changes<commit_after>package com.ocrapp;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Environment;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.EditText;

import com.ocrapp.imageui.ImagePreprocessor;
import com.ocrapp.savetoformat.SaveFormatActivity;

public class TextPreview extends Activity {
	
	private EditText textView;
	private String text;
	private final String modifiedImageDirectory = Environment.getExternalStorageDirectory() + "/tesseract/modimage.png";

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_text_preview);
		textView = (EditText) findViewById(R.id.editText1);
		
		text = getIntent().getExtras().getString("text");
		textView.setText(text);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.text_preview, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		int id = item.getItemId();
		if (id == R.id.action_settings) {
			return true;
		}
		else if(id == R.id.OK){
			Intent i = new Intent(this, SaveFormatActivity.class);
			i.putExtra("text", textView.getText().toString());
			startActivity(i);
			return true;
		}
		else if(id == R.id.cancel){
			Intent i = new Intent(this, ImagePreprocessor.class);
			i.putExtra("file", modifiedImageDirectory);
			startActivity(i);
			return true;
		}
		return super.onOptionsItemSelected(item);
	}
}

{'fraction_non_alphanumeric': 0.10722160970231533, 'fraction_numerical': 0.0005512679162072767, 'mean_word_length': 4.643856920684293, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '351734', 'n_tokens_mistral': 1180, 'n_tokens_neox': 1077, 'n_words': 286}