<commit_before>'use strict';

angular.module('myApp.main', ['ngSanitize', 'ngRoute']).
	config(['$routeProvider', function($routeProvider) {
		$routeProvider.when('/main', {
			templateUrl: 'main/main.html',
			controller: 'interviewFormCtrl'
		});
	}]).


	factory('dataCollection', ['$http', '$q', function($http, $q) {
		var deferred = $q.defer();
		var interviewUrl = 'http://www.carolchung/angular_front_end_interview/src/h5bp_readme.html'; //this url for dev
		//next url for production
		//var interviewUrl =  'https://cch5ng.github.io/angular_front_end_interview/src/h5bp_readme.html';

		//helper function

		/**
		 * @param data {string} html for the page, interviewUrl
		 * returns an array of list <li> nodes, with an element for each question category
		 *
		 */
		function getCategories(data) {  //alt could get this via <h4> but drop the last one for contributors; probably <h4> is more stable than the current selector?
//TODO getting data in the test
			var categoryList = angular.element(data).find('ol:nth-of-type(1)'); //$(data)
//TODO not getting any category list in the test
			console.log('categoryList: ' + categoryList)
			var categoryStr = categoryList[0].innerText;//innerHTML
			console.log('categoryStr: ' + categoryStr);

			return parseList(categoryStr);
		}

		/**
		 * @param str {string}
		 * given a string in list form, returns an array of strings, with
		 *     an element for each original line (if not blank)
		 *     Note that there are some issues where there are nested lists
		 *     this will result in empty strings in the resulting array
		 */
		function parseList(str) {
			var cleanList = [];<commit_msg>fix: cors path<commit_after>'use strict';

angular.module('myApp.main', ['ngSanitize', 'ngRoute']).
	config(['$routeProvider', function($routeProvider) {
		$routeProvider.when('/main', {
			templateUrl: 'main/main.html',
			controller: 'interviewFormCtrl'
		});
	}]).


	factory('dataCollection', ['$http', '$q', function($http, $q) {
		var deferred = $q.defer();
		var interviewUrl = 'http://www.carolchung.com/angular_front_end_interview/src/h5bp_readme.html'; //this url for dev
		//next url for production
		//var interviewUrl =  'https://cch5ng.github.io/angular_front_end_interview/src/h5bp_readme.html';

		//helper function

		/**
		 * @param data {string} html for the page, interviewUrl
		 * returns an array of list <li> nodes, with an element for each question category
		 *
		 */
		function getCategories(data) {  //alt could get this via <h4> but drop the last one for contributors; probably <h4> is more stable than the current selector?
//TODO getting data in the test
			var categoryList = angular.element(data).find('ol:nth-of-type(1)'); //$(data)
//TODO not getting any category list in the test
			console.log('categoryList: ' + categoryList)
			var categoryStr = categoryList[0].innerText;//innerHTML
			console.log('categoryStr: ' + categoryStr);

			return parseList(categoryStr);
		}

		/**
		 * @param str {string}
		 * given a string in list form, returns an array of strings, with
		 *     an element for each original line (if not blank)
		 *     Note that there are some issues where there are nested lists
		 *     this will result in empty strings in the resulting array
		 */
		function parseList(str) {
			var cleanList = [];
{'fraction_non_alphanumeric': 0.12926608275445484, 'fraction_numerical': 0.004228329809725159, 'mean_word_length': 3.786127167630058, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '6047650', 'n_tokens_mistral': 1091, 'n_tokens_neox': 980, 'n_words': 320}