<commit_before>'use strict';

angular.module('myApp.factories')

    .factory('stem', function () {
        //stem each sentence in the array
        var stemSentence = function (sentenceArray) {
            var results = [];
            sentenceArray.forEach(
                function(sentence) {
                    results.push(stemmer(sentence));
                }
            );
            return results;
        };

        //given an array of objects
        // where the key is the name of the term
        //and value is the number of occurences of the term
        //stem the key -> stem the name of the term
        var stemKey = function (keyWordsArray) {
            var results = [];
            for (var keyWord in keyWordsArray) {
                results[stemmer(keyWord)] = keyWordsArray[keyWord];
            }
            return results;
        };

        return {
            stem: stemSentence,
            stemKeyWords: stemKey
        }
    }
)
;<commit_msg>stem properly<commit_after>'use strict';

angular.module('myApp.factories')

    .factory('stem', function () {
        //stem each sentence in the array
        var stemSentence = function (sentenceArray) {
            var results = [];
            sentenceArray.forEach(
                function(sentence) {
                    results.push(stemmer(sentence));
                }
            );
            return results;
        };

        //stem the name of each keyword objects as defined in constant.js
        var stemName = function (keyWordsArray) {
            var result = [];
            for (var i = 0; i < keyWordsArray.length; i++) {
                var keyWord = keyWordsArray[i];
                var stemmedKeyWord = new Keyword();
                stemmedKeyWord.name = stemmer(keyWord.name);
                stemmedKeyWord.value = keyWord.value;
                result.push(stemmedKeyWord);
            }
            return result;
        };

        return {
            stem: stemSentence,
            stemKeyWords: stemName
        }
    }
)
;
{'fraction_non_alphanumeric': 0.09263773768893223, 'fraction_numerical': 0.00048756704046806434, 'mean_word_length': 1.4399524375743162, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '4417754', 'n_tokens_mistral': 548, 'n_tokens_neox': 501, 'n_words': 141}