<commit_before>(function () {
  'use strict';
  //var matchUsers = require('../../lib/matchUsers');
  //console.log(matchUsers);
  angular
    .module('chat')
    .controller('ChatController', ChatController);
     
  ChatController.$inject = ['$scope', '$state', 'Authentication', 'Socket'];

  function ChatController($scope, $state, Authentication, Socket) {
    var vm = this;

    vm.messages = [];
    vm.messageText = '';
    vm.sendMessage = sendMessage;
    vm.add = add;

    init();

    function init() {
      //matchUsers.pairLoneUsers(Socket.id);
      // If user is not signed in then redirect back home
      if (!Authentication.user) {
        $state.go('home');
      }

      // Make sure the Socket is connected
      if (!Socket.socket) {
        Socket.connect();
      }

      // Add an event listener to the 'chatMessage' event
      Socket.on('chatMessage', function (message) {<commit_msg>Update chat.client.controller.js<commit_after>(function () {
  'use strict';
  //var matchUsers = require('../../lib/matchUsers');
  //console.log(matchUsers);
  angular
    .module('chat')
    .controller('ChatController', ChatController);
     
  ChatController.$inject = ['$scope', '$state', 'Authentication', 'Socket'];
  
  

  function ChatController($scope, $state, Authentication, Socket) {
    var vm = this;

    vm.messages = [];
    vm.messageText = '';
    vm.sendMessage = sendMessage;
    vm.add = add;
    
    function getquery() {
      var path = require('path'),
        mongoose = require('mongoose'),
        db = mongoose.model('Topics'),
        errorHandler = require(path.resolve('./modules/core/server/controllers/errors.server.controller'));

        var rand = Math.random();
        var rand2 = Math.random();
        var topic = db.collection('Topics').find({name:1}).limit(-1).skip(rand).next();
        var prompt = db.collection('Topics').find({name: topic}, {prompt:1}).limit(-1).skip(rand2).next();

        document.getElementById("Topic").innerHTML = topic;
        document.getElementById("Prompt").innterHTML = topic;

    }

    init();

    function init() {
      //matchUsers.pairLoneUsers(Socket.id);
      // If user is not signed in then redirect back home
      if (!Authentication.user) {
        $state.go('home');
      }

      // Make sure the Socket is connected
      if (!Socket.socket) {
        Socket.connect();
      }

      // Add an event listener to the 'chatMessage' event
      Socket.on('chatMessage', function (message) {
{'fraction_non_alphanumeric': 0.15921787709497207, 'fraction_numerical': 0.0023942537909018356, 'mean_word_length': 2.7085798816568047, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6813255', 'n_tokens_mistral': 725, 'n_tokens_neox': 707, 'n_words': 164}