<commit_before>(function JaptemConfigControllerModule() {
	"use strict";

	angular.module('translate.app')
		.controller('japtemConfigController', JaptemConfigController);

	JaptemConfigController.$inject = ['ttsService', 'configService', 'fileSystemService'];

	function JaptemConfigController(ttsService, configService, fileSystemService) {
		var vm = this;

		vm.languages = [];
		vm.update = update;
		vm.openProfile = openProfile;
		vm.profile = null;
		vm.addMapRow = addMapRow;
		vm.removeRow = removeRow;

		ttsService.getVoices()
			.then(processVoices);

		configService.get('lang')
			.then(function (result) {
				vm.selectedLang = result || 'ja-JP';
			});

		configService.get('rate')
			.then(function (result) {
				vm.ttsRate = result || 0.8;
			});

		configService.get('profile')
			.then(function (result) {
				vm.profile = result;
			});

		function processVoices(voices) {
			vm.languages = voices.filter(filter);

			function filter(current) {
				return current.hasOwnProperty('lang') && current.hasOwnProperty('voiceName') && current.hasOwnProperty('gender') && current.gender === 'female';
			}
		}

		function update() {
			configService.set({
				lang: vm.selectedLang,
				rate: parseFloat(vm.ttsRate),
				profile: vm.profile
			});
		}

		function openProfile() {
			fileSystemService.readTextFile()
				.then(function (file) {
					var parsed = CSV.parse(file.data);
					var translations = [];
					for (var i = 0; i < parsed.length; i++) {
						var obj = parsed[i];
						if (!Array.isArray(obj) || obj.length < 2) {
							continue;
						}

						translations.push({
							key: obj[0],
							value: obj[1]
						});
					}


					vm.profile = {
						name: file.entry.name,
						translations: translations
					};

					vm.update();
				});
		}

		function addMapRow() {
			console.log(vm.mapRowAddKey);
			console.log(vm.mapRowAddValue);
			if (!vm.mapRowAddKey || !vm.mapRowAddValue) {
				return;
			}
			vm.profile.translations.push({
				key: vm.mapRowAddKey,
				value: vm.mapRowAddValue
			});
			vm.update();
			console.log(vm.profile);
			vm.mapRowAddKey = '';
			vm.mapRowAddValue = '';
			console.log(vm.mapRowAddKey);
			console.log(vm.mapRowAddValue);
		}

		function removeRow(index) {
			vm.profile.translations.splice(index, 1);
			vm.update();
		}
	}
})();<commit_msg>Removing logs, adding scroll to bottom<commit_after>(function JaptemConfigControllerModule() {
	"use strict";

	angular.module('translate.app')
		.controller('japtemConfigController', JaptemConfigController);

	JaptemConfigController.$inject = ['ttsService', 'configService', 'fileSystemService', '$timeout'];

	function JaptemConfigController(ttsService, configService, fileSystemService, $timeout) {
		var vm = this;

		vm.languages = [];
		vm.update = update;
		vm.openProfile = openProfile;
		vm.profile = null;
		vm.addMapRow = addMapRow;
		vm.removeRow = removeRow;

		ttsService.getVoices()
			.then(processVoices);

		configService.get('lang')
			.then(function (result) {
				vm.selectedLang = result || 'ja-JP';
			});

		configService.get('rate')
			.then(function (result) {
				vm.ttsRate = result || 0.8;
			});

		configService.get('profile')
			.then(function (result) {
				vm.profile = result;
			});

		var element = document.querySelector('.profile-edit-container');
		$timeout(function() {
			element.scrollTop = element.scrollHeight;
		});

		function processVoices(voices) {
			vm.languages = voices.filter(filter);

			function filter(current) {
				return current.hasOwnProperty('lang') && current.hasOwnProperty('voiceName') && current.hasOwnProperty('gender') && current.gender === 'female';
			}
		}

		function update() {
			configService.set({
				lang: vm.selectedLang,
				rate: parseFloat(vm.ttsRate),
				profile: vm.profile
			});
		}

		function openProfile() {
			fileSystemService.readTextFile()
				.then(function (file) {
					var parsed = CSV.parse(file.data);
					var translations = [];
					for (var i = 0; i < parsed.length; i++) {
						var obj = parsed[i];
						if (!Array.isArray(obj) || obj.length < 2) {
							continue;
						}

						translations.push({
							key: obj[0],
							value: obj[1]
						});
					}


					vm.profile = {
						name: file.entry.name,
						translations: translations
					};

					vm.update();
				});
		}

		function addMapRow() {
			if (!vm.mapRowAddKey || !vm.mapRowAddValue) {
				return;
			}
			vm.profile.translations.push({
				key: vm.mapRowAddKey,
				value: vm.mapRowAddValue
			});
			vm.update();
			vm.mapRowAddKey = '';
			vm.mapRowAddValue = '';
		}

		function removeRow(index) {
			vm.profile.translations.splice(index, 1);
			vm.update();
		}
	}
})();
{'fraction_non_alphanumeric': 0.15348439504061565, 'fraction_numerical': 0.002992731936725096, 'mean_word_length': 3.1702317290552586, 'pattern_counts': {'":': 0, '<': 7, '<?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': '926497', 'n_tokens_mistral': 1958, 'n_tokens_neox': 1534, 'n_words': 266}