<commit_before>package com.cmput301f16t11.a2b;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.ViewConfiguration;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioGroup;

/**
 * Created by john on 22/11/16.
 */

public class SearchByKeywordDialog extends Dialog {

    public enum searchCriteria{
        START,
        END,
        DESCRIPTION,
        NOT_SET
    }

    private searchCriteria selectedCriteria;
    private String searchString;

    SearchByKeywordDialog(Context context){
        super(context);
        setContentView(R.layout.search_by_keyword);
        selectedCriteria = searchCriteria.DESCRIPTION;

        setOnClickListeners(context);
    }

    private void setOnClickListeners(Context context){
        final RadioGroup selectorGroup = (RadioGroup)findViewById(R.id.searchGroup);
        final Button okButton = (Button) findViewById(R.id.okKeyword);
        final Button cancelButton= (Button) findViewById(R.id.cancelKeyword);

        selectorGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, int checkedId) {
                switch (checkedId){
                    case R.id.descriptionSelect:{
                        selectedCriteria = searchCriteria.DESCRIPTION;
                       return;
                    }
                    case R.id.startSelect:{
                        selectedCriteria = searchCriteria.START;
                       return;
                    }
                    case R.id.endSelect:{
                        selectedCriteria = searchCriteria.END;
                       return;
                    }
                    default:{
                        selectedCriteria = searchCriteria.NOT_SET;
                       return;
                    }
                }
            }
        });

        okButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                searchString = getEditTextString();
                dismiss();
            }
        });

        cancelButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //If this is set the parent activity will know the user cancelled
                selectedCriteria = searchCriteria.NOT_SET;
                dismiss();
            }
        });
    }

    public searchCriteria getSelectedCriteria() {
        return selectedCriteria;
    }

    public String getSearchString(){
        return searchString;
    }
    
    private String getEditTextString(){
        final EditText editText = (EditText) findViewById(R.id.textKeyword);
        return editText.getText().toString();
    }

}
<commit_msg>Forgot to push this tiny change with last commit<commit_after>package com.cmput301f16t11.a2b;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.ViewConfiguration;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioGroup;

/**
 * Created by john on 22/11/16.
 */

public class SearchByKeywordDialog extends Dialog {

    public enum searchCriteria{
        START,
        END,
        DESCRIPTION,
        NOT_SET
    }

    private searchCriteria selectedCriteria;
    private String searchString;

    SearchByKeywordDialog(Context context){
        super(context);
        setContentView(R.layout.search_by_keyword);
        selectedCriteria = searchCriteria.DESCRIPTION;

        setOnClickListeners(context);
    }

    private void setOnClickListeners(Context context){
        final RadioGroup selectorGroup = (RadioGroup)findViewById(R.id.searchGroup);
        final Button okButton = (Button) findViewById(R.id.okKeyword);
        final Button cancelButton= (Button) findViewById(R.id.cancelKeyword);

        selectorGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, int checkedId) {
                switch (checkedId){
                    case R.id.descriptionSelect:{
                        selectedCriteria = searchCriteria.DESCRIPTION;
                       return;
                    }
                    case R.id.startSelect:{
                        selectedCriteria = searchCriteria.START;
                       return;
                    }
                    case R.id.endSelect:{
                        selectedCriteria = searchCriteria.END;
                       return;
                    }
                    default:{
                        selectedCriteria = searchCriteria.NOT_SET;
                       return;
                    }
                }
            }
        });

        okButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                searchString = getEditTextString();
                dismiss();
            }
        });

        cancelButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //If this is set the parent activity will know the user cancelled
                selectedCriteria = searchCriteria.NOT_SET;
                dismiss();
            }
        });
    }

    public searchCriteria getSelectedCriteria() {
        return selectedCriteria;
    }

    public String getSearchString(){
        return searchString;
    }

    private String getEditTextString(){
        final EditText editText = (EditText) findViewById(R.id.textKeyword);
        return editText.getText().toString();
    }

}

{'fraction_non_alphanumeric': 0.07429062768701633, 'fraction_numerical': 0.004815133276010318, 'mean_word_length': 1.7603227337446608, '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': '6720796', 'n_tokens_mistral': 1404, 'n_tokens_neox': 1311, 'n_words': 300}