<commit_before>//our root app component
import {Component, View, CORE_DIRECTIVES} from 'angular2/angular2'

@Component({
  selector: 'my-app'
  templateUrl: 'src/main.html',
  directives: [CORE_DIRECTIVES]
})
export class App {
  enterText($event, newText) {
    if (newText) {
      this.textToRead = newText.value;
    }
  }

  public textToRead;
  rate = 1.0;

  startRead() {
    this.speek2();
  };

  speek1() {
    var u = new SpeechSynthesisUtterance();
    u.text = this.textToRead;
    u.lang = 'en-US';
    u.rate = this.rate;
    speechSynthesis.speak(u);
  };

  speek2() {
    var speech = new SpeechSynthesisUtterance(this.textToRead);
    var voices = window.speechSynthesis.getVoices();
    speech.default = false;
    speech.voice = voices.filter(function(voice) { return voice.name == 'Google UK English Male'; })[0];
    speech.lang = 'en-GB'; //Also added as for some reason android devices used for testing loaded spanish language
    window.speechSynthesis.speak(speech);
  }
}<commit_msg>on end<commit_after>//our root app component
import {Component, View, CORE_DIRECTIVES} from 'angular2/angular2'

@Component({
  selector: 'my-app'
  templateUrl: 'src/main.html',
  directives: [CORE_DIRECTIVES]
})
export class App {
  enterText($event, newText) {
    if (newText) {
      this.textToRead = newText.value;
    }
  }

  public textToRead;
  rate = 1.0;

  startRead() {
    this.speek2();
  };

  speek1() {
    var u = new SpeechSynthesisUtterance();
    u.text = this.textToRead;
    u.lang = 'en-US';
    u.rate = this.rate;
    speechSynthesis.speak(u);
  };

  speek2() {
    var speech = new SpeechSynthesisUtterance(this.textToRead);
    var voices = window.speechSynthesis.getVoices();
    speech.default = false;
    speech.voice = voices.filter(function(voice) { return voice.name == 'Google UK English Male'; })[0];
    speech.lang = 'en-GB'; //Also added as for some reason android devices used for testing loaded spanish language
    var that = this;
    speech.onend = function(event) {
      //that.textToRead = '';
    }
    window.speechSynthesis.speak(speech);
  }
}
{'fraction_non_alphanumeric': 0.1350071056371388, 'fraction_numerical': 0.007579346281383231, 'mean_word_length': 3.292682926829268, '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': '555930', 'n_tokens_mistral': 748, 'n_tokens_neox': 714, 'n_words': 167}