<commit_before>
package ca.knoblauch.dialog;

import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.speech.RecognizerIntent;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.Chronometer;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;

import java.security.AccessControlContext;
import java.util.ArrayList;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.TimeUnit;

/**
 * Created by gknoblau on 2016-01-30.
 */



public class StartActivity extends Activity{

    private TextView txtSpeechOutput;
    private ImageButton btnSpeak;
    private speechModel sm = speechModel.getInstance();
    private String voiceString;
    private Boolean startAnalysis = false;
    private final int REQ_CODE_SPEECH_INPUT = 100;
    public static final String  timeTillStop = "500";
    //public String targetText;
   //public EditText scriptInput;
    public String inputTextVal;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        //scriptInput = (EditText) findViewById(R.id.scriptInput);
        btnSpeak = (ImageButton) findViewById(R.id.btnSpeak);


        btnSpeak.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //scriptInput.getText();
                promptSpeechInput();
            }
        });
    }

    private void analysis() {
        long stopTime = System.currentTimeMillis() / 1000L;
        sm.setActualTime((int) (stopTime - startTime));
        sm.importVoiceText(voiceString);
        //inputTextVal = ""+scriptInput.getText();
        //if (inputTextVal.length()>4){
        //    sm.setTargetText(""+scriptInput);
        //}
        Intent intent = new Intent(this, results.class);
        startActivity(intent);

    }

    /**
     * Showing google speech input dialog
     * */
    long startTime;
    private void promptSpeechInput() {
        startTime = System.currentTimeMillis() / 1000L;
        Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
        intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
        intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());
        intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS, 4000);
        intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS, 4000);
        intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS, 4000);


        intent.putExtra(RecognizerIntent.EXTRA_PROMPT,
                getString(R.string.speech_prompt));
        try {
            startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);
        } catch (ActivityNotFoundException a) {
            Toast.makeText(getApplicationContext(),
                    getString(R.string.speech_not_supported),
                    Toast.LENGTH_SHORT).show();
        }
    }<commit_msg>WE ARE DONE!!!!<commit_after>
package ca.knoblauch.dialog;

import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.speech.RecognizerIntent;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.Chronometer;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;

import java.security.AccessControlContext;
import java.util.ArrayList;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.TimeUnit;

/**
 * Created by gknoblau on 2016-01-30.
 */



public class StartActivity extends Activity{

    private TextView txtSpeechOutput;
    private ImageButton btnSpeak;
    private speechModel sm = speechModel.getInstance();
    private String voiceString;
    private Boolean startAnalysis = false;
    private final int REQ_CODE_SPEECH_INPUT = 100;
    public static final String  timeTillStop = "4000";
    //public String targetText;
   //public EditText scriptInput;
    public String inputTextVal;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        //scriptInput = (EditText) findViewById(R.id.scriptInput);
        btnSpeak = (ImageButton) findViewById(R.id.btnSpeak);


        btnSpeak.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //scriptInput.getText();
                promptSpeechInput();
            }
        });
    }

    private void analysis() {
        long stopTime = System.currentTimeMillis() / 1000L;
        sm.setActualTime((int) (stopTime - startTime));
        sm.importVoiceText(voiceString);
        //inputTextVal = ""+scriptInput.getText();
        //if (inputTextVal.length()>4){
        //    sm.setTargetText(""+scriptInput);
        //}
        Intent intent = new Intent(this, results.class);
        startActivity(intent);

    }

    /**
     * Showing google speech input dialog
     * */
    long startTime;
    private void promptSpeechInput() {
        startTime = System.currentTimeMillis() / 1000L;
        Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
        intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
        intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());
        intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS, timeTillStop);
        intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS, timeTillStop);
        intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS, timeTillStop);


        intent.putExtra(RecognizerIntent.EXTRA_PROMPT,
                getString(R.string.speech_prompt));
        try {
            startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);
        } catch (ActivityNotFoundException a) {
            Toast.makeText(getApplicationContext(),
                    getString(R.string.speech_not_supported),
                    Toast.LENGTH_SHORT).show();
        }
    }
{'fraction_non_alphanumeric': 0.09386828160484481, 'fraction_numerical': 0.008932626797880395, 'mean_word_length': 3.2319026265214608, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6812689', 'n_tokens_mistral': 1991, 'n_tokens_neox': 1860, 'n_words': 342}