<commit_before>/**
 * Web Socket Singleton Service
 * @author <NAME> <<EMAIL>>
 */
(function () {
    angular.module('trifecta')
        .factory('WebSockets', function ($log, Consumers, Topics) {
            var service = {};

            // establish the web socket connection
            if (!window.WebSocket) {
                window.WebSocket = window.MozWebSocket;
            }

            var socket;
            if (window.WebSocket) {
                $log.info("Connecting to websocket...");
                socket = new WebSocket("ws://localhost:8888/websocket/");
                $log.info("socket = " + angular.toJson(socket));

                socket.onopen = function (event) {
                    // $log.info("onOpen: event = " + angular.toJson(event));
                };<commit_msg>the web socket endpoint should be dynamically generated<commit_after>/**
 * Web Socket Singleton Service
 * @author <NAME> <<EMAIL>>
 */
(function () {
    angular.module('trifecta')
        .factory('WebSockets', function ($location, $log, Consumers, Topics) {
            var service = {};

            // establish the web socket connection
            if (!window.WebSocket) {
                window.WebSocket = window.MozWebSocket;
            }

            var socket;
            if (window.WebSocket) {
                var endpoint = "ws://" + $location.host() + ":" + $location.port() + "/websocket/";
                $log.info("Connecting to websocket endpoint '" + endpoint + "'...");
                socket = new WebSocket(endpoint);
                $log.info("socket = " + angular.toJson(socket));

                socket.onopen = function (event) {
                    // $log.info("onOpen: event = " + angular.toJson(event));
                };
{'fraction_non_alphanumeric': 0.14407260351673284, 'fraction_numerical': 0.0022688598979013048, 'mean_word_length': 1.75195007800312, 'pattern_counts': {'":': 1, '<': 9, '<?xml version=': 0, '>': 9, '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': '5615186', 'n_tokens_mistral': 486, 'n_tokens_neox': 457, 'n_words': 104}