<commit_before>﻿namespace Hangman.Logic
{
    using Utils;
    using System;

    public class Player
    {
        private string playerName;
        private int score;
        private Validator validator;

        public Player(string playerName, int score)
        {
            this.PlayerName = playerName;
            this.Score = score; 
        }

        public string PlayerName
        {
            get 
            {
                return playerName; 
            }

            set 
            {
                if (!validator.PlayerNameValidator(value))
                {
                    throw new ArgumentException("Invalid name!");
                }
<commit_msg>Regressionfix: validator was not initialized<commit_after>﻿namespace Hangman.Logic
{
    using Utils;
    using System;

    public class Player
    {
        private string playerName;
        private int score;
        private readonly Validator validator;

        public Player(string playerName, int score)
        {
            this.validator = new Validator();
            this.PlayerName = playerName;
            this.Score = score;
        }

        public string PlayerName
        {
            get 
            {
                return playerName; 
            }

            set 
            {
                if (!validator.PlayerNameValidator(value))
                {
                    throw new ArgumentException("Invalid name!");
                }

{'fraction_non_alphanumeric': 0.061855670103092786, 'fraction_numerical': 0.0, 'mean_word_length': 1.2538699690402477, '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': '4483446', 'n_tokens_mistral': 351, 'n_tokens_neox': 326, 'n_words': 88}