<commit_before>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Linq;

namespace Matt.Mih.Helper
{
    public class NameHandler
    {
        public XDocument NamesXml { get; set; }

        public AutoCompleteStringCollection AutoCompleteNames { get; set; }

        private static readonly string xmlFile = "names.xml";

        public NameHandler()
        {
            AutoCompleteNames = new AutoCompleteStringCollection();

            try
            {
                NamesXml = XDocument.Load(xmlFile);

                String[] names = (from name in NamesXml.Descendants("Name")
                                  select (string)name).ToArray();

                AutoCompleteNames.AddRange(names);
            }
            catch (FileNotFoundException)
            {
                NamesXml = new XDocument(new XDeclaration("1.0", "utf-8", "yes"), new XElement("SummonerNames"));
                NamesXml.Save(xmlFile);<commit_msg>Removed Exception handling of a non existant names.xml. Changed to If<commit_after>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Linq;

namespace Matt.Mih.Helper
{
    public class NameHandler
    {
        public XDocument NamesXml { get; set; }

        public AutoCompleteStringCollection AutoCompleteNames { get; set; }

        private static readonly string xmlFile = "names.xml";

        public NameHandler()
        {
            AutoCompleteNames = new AutoCompleteStringCollection();

            if(File.Exists(xmlFile))
            {
                NamesXml = XDocument.Load(xmlFile);

                String[] names = (from name in NamesXml.Descendants("Name")
                                  select (string)name).ToArray();

                AutoCompleteNames.AddRange(names);
            }
            else
            {
                NamesXml = new XDocument(new XDeclaration("1.0", "utf-8", "yes"), new XElement("SummonerNames"));
                NamesXml.Save(xmlFile);
{'fraction_non_alphanumeric': 0.09508644222020018, 'fraction_numerical': 0.00272975432211101, 'mean_word_length': 2.1640287769784172, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4014606', 'n_tokens_mistral': 574, 'n_tokens_neox': 553, 'n_words': 138}