<commit_before>﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using VKDiscordBot.Models;

namespace VKDiscordBot.Services
{
    public class Tasker : BotServiceBase
    {
        private List<RepetitiveTask> _tasks;

        public Tasker()
        {
            _tasks = new List<RepetitiveTask>();
        }

        public void Add(RepetitiveTask task)
        {
            _tasks.Add(task);
            RaiseLog(Discord.LogSeverity.Verbose, $"Added new repetitive task: {task.Id}");
        }

        public void AddAndStart(RepetitiveTask task)
        {
            Add(task);
            task.Start();
        }

        public RepetitiveTask Find(Predicate<RepetitiveTask> match)
        {
            return _tasks.Find(match);
        }
    }
}
<commit_msg>Add remove functions to Tasker<commit_after>﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using VKDiscordBot.Models;

namespace VKDiscordBot.Services
{
    public class Tasker : BotServiceBase
    {
        private List<RepetitiveTask> _tasks;

        public Tasker()
        {
            _tasks = new List<RepetitiveTask>();
        }

        public void Add(RepetitiveTask task)
        {
            _tasks.Add(task);
            RaiseLog(Discord.LogSeverity.Verbose, $"Added new repetitive task: {task.Id}");
        }

        public void AddAndStart(RepetitiveTask task)
        {
            Add(task);
            task.Start();
        }

        public void Remove(RepetitiveTask task)
        {
            if (_tasks.Contains(task))
            {
                _tasks.Remove(task);
                RaiseLog(Discord.LogSeverity.Verbose, $"Removed repetitive task: {task.Id}");
            }
        }

        public void Remove(int taskId)
        {
            var task = _tasks.Find(t => t.Id == taskId);
            if (task != null)
            {
                Remove(task);
            }
        }

        public RepetitiveTask Find(Predicate<RepetitiveTask> match)
        {
            return _tasks.Find(match);
        }
    }
}

{'fraction_non_alphanumeric': 0.09463869463869463, 'fraction_numerical': 0.0, 'mean_word_length': 1.8052287581699347, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 10, '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': '2738764', 'n_tokens_mistral': 633, 'n_tokens_neox': 601, 'n_words': 123}