<commit_before>﻿using Spark.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Spark.Service
{
    
    public class ServiceListener : IServiceListener
    {
        List<IServiceListener> listeners;

        public ServiceListener()
        {
            listeners = new List<IServiceListener>();
        }

        public void Add(IServiceListener listener)
        {
            this.listeners.Add(listener);
        }

        private void Inform(IServiceListener listener, Uri location, Interaction interaction)
        {
            try
            {
                listener.Inform(location, interaction);
            }
            catch(Exception e)
            {
                throw e;
                //TODO: Package this up as a sensible error, not just a 500?
            }
        }

        public void Clear()
        {
            listeners.Clear();
        }

        public void Inform(Uri location, Interaction interaction)
        {
            foreach(IServiceListener listener in listeners)
            {
                Inform(listener, location, interaction);
            }<commit_msg>Deleted Try catch from ServiceListener.Inform<commit_after>﻿using Spark.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Spark.Service
{
    
    public class ServiceListener : IServiceListener
    {
        List<IServiceListener> listeners;

        public ServiceListener()
        {
            listeners = new List<IServiceListener>();
        }

        public void Add(IServiceListener listener)
        {
            this.listeners.Add(listener);
        }

        private void Inform(IServiceListener listener, Uri location, Interaction interaction)
        {
            listener.Inform(location, interaction);
        }

        public void Clear()
        {
            listeners.Clear();
        }

        public void Inform(Uri location, Interaction interaction)
        {
            foreach(IServiceListener listener in listeners)
            {
                Inform(listener, location, interaction);
            }
{'fraction_non_alphanumeric': 0.07378904481665913, 'fraction_numerical': 0.001358080579447714, 'mean_word_length': 1.8297055057618439, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '7472534', 'n_tokens_mistral': 537, 'n_tokens_neox': 516, 'n_words': 135}