<commit_before>'use strict';

/**
 * @ngdoc service
 * @name wavesApp.InflectionsAPIService
 * @description
 * # InflectionsAPIService
 * Service in the wavesApp.
 */
angular.module('wavesApp')
  .service('InflectionsAPIService', ['$http', function ($http) {
      return {
        fetchStartupData: function(key, limit){
          return $http({
            method: 'POST',
            url: '/', 
            data: {key: key, limit: limit}
          });
        },
        
        sendRecognition: function(words){
          return $http({
            method: 'POST',
            url: '/inflect', 
            data: "words[]="+JSON.stringify(words)
          });
        }
      };
    }]);<commit_msg>FIX on post words to InflectAPI.<commit_after>'use strict';

/**
 * @ngdoc service
 * @name wavesApp.InflectionsAPIService
 * @description
 * # InflectionsAPIService
 * Service in the wavesApp.
 */
angular.module('wavesApp')
  .service('InflectionsAPIService', ['$http', function ($http) {
      return {
        fetchStartupData: function(key, limit){
          return $http({
            method: 'POST',
            url: '/', 
            data: {key: key, limit: limit}
          });
        },
        
        sendRecognition: function(words){
          return $http({
            method: 'POST',
            url: '/inflect', 
            transformRequest: function(obj) {
              var str = [];
              for(var p in obj)
              str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
              return str.join("&");
            },
            headers:{
              "Content-Type": "application/x-www-form-urlencoded",
            },
            data: {
              "words[]": words
            }
          });
        }
      };
    }]);
{'fraction_non_alphanumeric': 0.14573991031390135, 'fraction_numerical': 0.0, 'mean_word_length': 1.6444444444444444, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, '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': '5098439', 'n_tokens_mistral': 498, 'n_tokens_neox': 494, 'n_words': 103}