<commit_before>'use strict';

var myApp = angular.module('myApp.controllers', ['fhcloud']);

myApp.controller('MainCtrl', function($scope, fhcloud) {
    console.log('MainCtrl', $scope);
    // add function to pass userInput to cloud via
    // $fh.cloud call to controller scope
    $scope.getNumberOfCharacters = function(userInput) {
      console.log("getNumberOfCharacters", userInput);
      var reqJson = {
        "head": {},
        "payload": {
          "userInput": userInput
        }
      };
      // check if userInput is defined
      if (reqJson.payload.userInput) {
        // if defined, pass userInput and callback
        // fn to fhcloud service
        fhcloud.cloud('example', reqJson, success, error);
      }
    };
    // success callback function
    var success = function(res) {
      console.log("fhcloud > exampleAction > success", res);
      // if successful redirect to home<commit_msg>Updated to count endpoint to be more clear<commit_after>'use strict';

var myApp = angular.module('myApp.controllers', ['fhcloud']);

myApp.controller('MainCtrl', function($scope, fhcloud) {
    // add function to pass userInput to cloud via
    // $fh.cloud call to controller scope
    $scope.getNumberOfCharacters = function(userInput) {
      var reqJson = {
        "payload": {
          "userInput": userInput
        }
      };
      // check if userInput is defined
      if (reqJson.payload.userInput) {
        // if defined, pass userInput and callback
        // fn to fhcloud service
        fhcloud.cloud('count', reqJson, success, error);
      }
    };
    // success callback function
    var success = function(res) {
      // if successful redirect to home
{'fraction_non_alphanumeric': 0.11778563015312132, 'fraction_numerical': 0.0, 'mean_word_length': 2.561844863731656, 'pattern_counts': {'":': 5, '<': 3, '<?xml version=': 0, '>': 5, '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': '4702728', 'n_tokens_mistral': 474, 'n_tokens_neox': 466, 'n_words': 137}